display update
This commit is contained in:
parent
c72a0d48df
commit
0a93b99021
Binary file not shown.
|
@ -63,6 +63,8 @@ class CUDDisplay : public ESPMegaDisplay
|
||||||
CUDDisplay(cud_display_conf_t *conf);
|
CUDDisplay(cud_display_conf_t *conf);
|
||||||
void begin(cud_display_cards_t cards);
|
void begin(cud_display_cards_t cards);
|
||||||
void display_init();
|
void display_init();
|
||||||
|
void set_ac_lock(bool state);
|
||||||
|
bool get_ac_lock();
|
||||||
private:
|
private:
|
||||||
// States Calculation
|
// States Calculation
|
||||||
bool get_lights_state();
|
bool get_lights_state();
|
||||||
|
@ -87,8 +89,6 @@ class CUDDisplay : public ESPMegaDisplay
|
||||||
// Helper Functions
|
// Helper Functions
|
||||||
void system_toggle();
|
void system_toggle();
|
||||||
// AC Functions and Variables
|
// AC Functions and Variables
|
||||||
void set_ac_lock(bool state);
|
|
||||||
bool get_ac_lock();
|
|
||||||
bool ac_locked;
|
bool ac_locked;
|
||||||
uint8_t previous_mode; // Used to store mode prior to turning off
|
uint8_t previous_mode; // Used to store mode prior to turning off
|
||||||
// Local Variables
|
// Local Variables
|
||||||
|
|
|
@ -81,6 +81,9 @@ void setup()
|
||||||
ESP_LOGV("CUD IoT OS", "Initializing Air Conditioner");
|
ESP_LOGV("CUD IoT OS", "Initializing Air Conditioner");
|
||||||
espmega.installCard(2, &ac);
|
espmega.installCard(2, &ac);
|
||||||
ac.bindFRAM(&espmega.fram, AC_FRAM_ADDR);
|
ac.bindFRAM(&espmega.fram, AC_FRAM_ADDR);
|
||||||
|
ac.loadStateFromFRAM();
|
||||||
|
ac.setFRAMAutoSave(true);
|
||||||
|
ESP_LOGD("CUD IoT OS", "Loaded Air Conditioner State from FRAM, Temperature: %d, Mode: %d, Fan Speed: %d", ac.getTemperature(), ac.getMode(), ac.getFanSpeed());
|
||||||
espmega.display->bindClimateCard(&ac); // Show our climate card on the display
|
espmega.display->bindClimateCard(&ac); // Show our climate card on the display
|
||||||
// Register all cards with iot
|
// Register all cards with iot
|
||||||
ESP_LOGV("CUD IoT OS", "Registering Cards with IoT");
|
ESP_LOGV("CUD IoT OS", "Registering Cards with IoT");
|
||||||
|
|
|
@ -64,9 +64,9 @@
|
||||||
/***********************************************
|
/***********************************************
|
||||||
* Persistent Storage Configuration *
|
* Persistent Storage Configuration *
|
||||||
***********************************************/
|
***********************************************/
|
||||||
#define AC_FRAM_ADDR 5000 // 2 bytes
|
#define AC_FRAM_ADDR 10000 // 3 bytes
|
||||||
#define AC_LOCK_FRAM_ADDR 5002 // 1 byte
|
#define AC_LOCK_FRAM_ADDR 10005 // 1 byte
|
||||||
#define AC_DISPLAY_MODE_FRAM_ADDR 5003 // 1 byte
|
#define AC_DISPLAY_MODE_FRAM_ADDR 10010 // 1 byte
|
||||||
|
|
||||||
/***********************************************
|
/***********************************************
|
||||||
* Remote Variables *
|
* Remote Variables *
|
||||||
|
|
Loading…
Reference in New Issue