small fix for mode event heater #656

Merged
muellerr merged 4 commits from tcs-heater-event-fix into v2.1.0-dev 2023-05-30 16:47:21 +02:00
2 changed files with 4 additions and 2 deletions

View File

@ -86,6 +86,8 @@ will consitute of a breaking change warranting a new major release:
- Some smaller logic fixes in the TM store base class
- Fixed usage of C `abs` instead of C++ `std::abs`, which results in MTQ commands not being
scaled correctly between 1Am² and 0.2Am².
- TCS Heater Handler: Always trigger mode event if a heater goes `OFF` or `ON`. This event might
soon replace the `HEATER_WENT_ON` and `HEATER_WENT_OFF` events.
- Prevent spam of TCS controller heater unavailability event if all heaters are in external control.
# [v2.0.5] 2023-05-11

View File

@ -269,7 +269,7 @@ void HeaterHandler::handleSwitchOnCommand(heater::Switch heaterIdx) {
} else {
triggerEvent(HEATER_WENT_ON, heaterIdx, 0);
EventManagerIF::triggerEvent(helper.heaters[heaterIdx].first->getObjectId(), MODE_INFO,
MODE_ON, MODE_OFF);
MODE_ON, 0);
{
MutexGuard mg(handlerLock, LOCK_TYPE, LOCK_TIMEOUT, LOCK_CTX);
heater.switchState = ON;
@ -327,7 +327,7 @@ void HeaterHandler::handleSwitchOffCommand(heater::Switch heaterIdx) {
}
triggerEvent(HEATER_WENT_OFF, heaterIdx, 0);
EventManagerIF::triggerEvent(helper.heaters[heaterIdx].first->getObjectId(), MODE_INFO,
MODE_OFF, MODE_ON);
MODE_OFF, 0);
// When all switches are off, also main line switch will be turned off
if (allSwitchesOff()) {
mainLineSwitcher->sendSwitchCommand(mainLineSwitch, PowerSwitchIF::SWITCH_OFF);