Skip to content

Commit

Permalink
#69 JandyDvce: Ignoring set SWG device to state '0x0c', state is unknown
Browse files Browse the repository at this point in the history
Signed-off-by: Lee Ballard <[email protected]>
  • Loading branch information
ballle98 committed Jun 29, 2023
1 parent cec6acf commit 507a9fd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions devices_jandy.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,16 +201,20 @@ bool isSWGDeviceErrorState(unsigned char status)
}

void setSWGdeviceStatus(struct aqualinkdata *aqdata, emulation_type requester, unsigned char status) {
if (aqdata->ar_swg_device_status == status)
static unsigned char last_status = SWG_STATUS_UNKNOWN;

if ((aqdata->ar_swg_device_status == status) || (last_status == status)) {
return;
}
last_status = status;

// If we get (ALLBUTTON, SWG_STATUS_CHECK_PCB), it sends this for many status, like clean cell.
// So if we are in one of those states, don't use it.

if (requester == ALLBUTTON && status == SWG_STATUS_CHECK_PCB ) {
if (aqdata->ar_swg_device_status > SWG_STATUS_ON &&
aqdata->ar_swg_device_status < SWG_STATUS_TURNING_OFF) {
LOG(DJAN_LOG, LOG_DEBUG, "Ignoreing set SWG device state to '0x%02hhx', request from %d\n", aqdata->ar_swg_device_status, requester);
LOG(DJAN_LOG, LOG_DEBUG, "Ignoring set SWG device state to '0x%02hhx', request from %d\n", aqdata->ar_swg_device_status, requester);
return;
}
}
Expand Down

0 comments on commit 507a9fd

Please sign in to comment.