WIP, light should 'work' hopefully

This commit is contained in:
reaw55 2024-02-03 05:48:59 +07:00
parent 70f6ae0092
commit f0bdfe0d03
4 changed files with 432 additions and 22 deletions

View file

@ -6,6 +6,27 @@
#include <ClimateCard.hpp>
/*
tentetive pin mapping
1-4 Lights
1: row 1
2: row 2
3: row 3
4: row 4
5: Air Purifier status (on/off)
6: Air Purifier fan speed (0-20)
lights have 4 states
0: off
1: low
2: mid
3: high
*/
// Touch Types
#define TOUCH_TYPE_PRESS 1
#define TOUCH_TYPE_RELEASE 0
@ -172,10 +193,10 @@
#define COMPONENT_LIGHT_MASTER_ON_PRESSED 38
//light level component
#define COMPONENT_LIGHT_LEVEL_1 39
#define COMPONENT_LIGHT_LEVEL_2 40
#define COMPONENT_LIGHT_LEVEL_3 41
#define COMPONENT_LIGHT_LEVEL_4 42
#define COMPONENT_LIGHT_LEVEL_0 39
#define COMPONENT_LIGHT_LEVEL_1 40
#define COMPONENT_LIGHT_LEVEL_2 41
#define COMPONENT_LIGHT_LEVEL_3 42
@ -235,7 +256,6 @@ class ISEDisplay : public ESPMegaDisplay {
void handleTouch(uint8_t page, uint8_t component, uint8_t touch_type);
void handlePWMChange(uint8_t pin, bool state, uint16_t value);
void setPMstate(bool is_pm_on, uint8_t pm_fan_speed);
void setACstate(uint8_t ac_fan_speed, uint8_t ac_mode, uint8_t ac_temperature);
void setLightLevel(uint8_t row, uint8_t level);
@ -245,8 +265,11 @@ class ISEDisplay : public ESPMegaDisplay {
ClimateCard *climateCard;
uint8_t outputCallbackHandle;
uint8_t climateCallbackHandle;
uint8_t user_mode;
void updateLightGroupState();
void updateLightGroupStatePageDashboard();
void updateLightGroupStatePageStandby();
void updateAirPurifierState();
void updateACState();
bool calculateLightGroupState();
};