123456789101112131415161718192021222324252627282930313233343536373839404142 |
- #include "HomeActivity.h"
- #include "Boiler.h"
- #include "defines.h"
- #include "Helpers.h"
- #include "Logs.h"
- #include "globals.h"
- #include "BaseActivity.h"
-
- HomeActivity::HomeActivity()
- : BaseActivity(nullptr, &g_menuWaterActivity)
- {
- }
-
- void HomeActivity::getLcdText(char** lines)
- {
- getLineText(lines[0], 'S', &g_appState.tanks[0]);
- getLineText(lines[1], 'C', &g_appState.tanks[1]);
- }
-
- void HomeActivity::getLineText(
- char* line
- , char prefix
- , const BoilerTankState* boilerItemState
- )
- {
- char curTmp[7], setTmp[7];
- Helpers::tempToStr(curTmp, boilerItemState->input->getValue(), 5);
- Helpers::tempToStr(setTmp,
- boilerItemState->mode == BoilerTankState::Auto ? boilerItemState->setting : TEMP_T_INVALID, 4);
- snprintf(line, 17, "%c:%s [%s] %c", prefix, curTmp, setTmp,
- boilerItemState->relay->isEnabled() ? LCD_CHAR_SENSOR : ' ');
- }
-
- void HomeActivity::loop()
- {
- if (g_appState.tanks[0].input->hasChanged() || g_appState.tanks[1].input->hasChanged())
- {
- LOG(1, "HomeActivity: Input has changed");
- m_lcdUpdateNeeded = true;
- }
- BaseActivity::loop();
- }
|