Last row no work

This commit is contained in:
reaw 2024-02-16 02:42:55 +07:00
parent 2689166f45
commit 59b6a10de8
3 changed files with 15 additions and 27 deletions

View file

@ -275,33 +275,21 @@ void ISEDisplay::handlePWMChange(uint8_t pin, bool state, uint16_t value)
uint8_t current_page = this->currentPage;
if (current_page == PAGE_STANDBY)
{
if (pin >= 1 && pin <= 4)
if ((pin >= 0 && pin <= 3) ||(pin >= 8 && pin <= 11))
{
// Light
updateLightGroupStatePageStandby();
// time_since_last_screen_update = millis(); // update time since last activity
}
else if (pin == 5 || pin == 6)
{
// Air Purifier
updateAirPurifierStateStandby();
// time_since_last_screen_update = millis(); // update time since last activity
}
}
else if (current_page == PAGE_DASHBOARD)
{
if (pin >= 1 && pin <= 4)
if ((pin >= 0 && pin <= 3) ||(pin >= 8 && pin <= 11))
{
// Light
updateLightGroupStatePageDashboard();
// time_since_last_screen_update = millis(); // update time since last activity
}
else if (pin == 5 || pin == 6)
{
// Air Purifier
updateAirPurifierState();
// time_since_last_screen_update = millis(); // update time since last activity
}
}
else
{
@ -589,8 +577,8 @@ void ISEDisplay::setLightLevel(uint8_t row, uint8_t level)
break;
}
this->outputCard->setValue(primary_pin, primary);
this->outputCard->setValue(secondary_pin, secondary);
this->outputCard->setState(primary_pin, primary);
this->outputCard->setState(secondary_pin, secondary);
}
u_int8_t ISEDisplay::getLightLevel(uint8_t row)
@ -600,8 +588,8 @@ u_int8_t ISEDisplay::getLightLevel(uint8_t row)
//lightLevel = this->outputCard->getValue(row);
uint8_t primary_pin = *(light_array + 2*(row - 1));
uint8_t secondary_pin = *(light_array + 2*(row - 1) + 1);
bool primary = this->outputCard->getValue(primary_pin);
bool secondary = this->outputCard->getValue(secondary_pin);
bool primary = this->outputCard->getState(primary_pin);
bool secondary = this->outputCard->getState(secondary_pin);
if (primary && secondary)
{
lightLevel = 3;