rename summer/winter switch to heatingMainSwitch
This commit is contained in:
22
dist/MaxThermostat.js
vendored
22
dist/MaxThermostat.js
vendored
@ -9,7 +9,7 @@ const DISABLED_TEMPERATURE = 5.0;
|
||||
class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
constructor(floor, room, item, label, hmId, hardDisablers) {
|
||||
super(floor, room, item, label, hmId);
|
||||
this.summerFlag = false;
|
||||
this.heatingMainFlag = false;
|
||||
this.temperatureTopic = `${this.topicFirstPart}/temperature`;
|
||||
this.temperatureFeedbackTopic = `${this.topicFirstPart}/temperature/feedback`;
|
||||
this.presetTemperatureTopic = `${this.topicFirstPart}/presetTemperature`;
|
||||
@ -22,7 +22,7 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
this.presetTemperatureTopic,
|
||||
this.deviceFeedbackTopic,
|
||||
this.commandTopic,
|
||||
MaxThermostat.summerSwitchTopic
|
||||
MaxThermostat.heatingMainSwitchTopic
|
||||
];
|
||||
this.hardDisabled = false;
|
||||
this.hardDisablerMap = {};
|
||||
@ -38,8 +38,8 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
exportItem() {
|
||||
return Export_1.ThermostatExport(this.itemId, this.label, this.temperatureTopic, this.temperatureFeedbackTopic, this.presetTemperatureTopic, this.presetTemperatureFeedbackTopic);
|
||||
}
|
||||
static exportSummerSwitchItem() {
|
||||
return Export_1.SummerSwitchExport(MaxThermostat.summerSwitchTopic);
|
||||
static exportHeatingMainSwitchItem() {
|
||||
return Export_1.HeatingMainSwitchExport(MaxThermostat.heatingMainSwitchTopic);
|
||||
}
|
||||
setPresetTemperature(presetTemperature) {
|
||||
this.presetTemperature = presetTemperature;
|
||||
@ -54,7 +54,7 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
setTemperature = true;
|
||||
}
|
||||
else if (topic == this.commandTopic) {
|
||||
if (!this.summerFlag) {
|
||||
if (this.heatingMainFlag) {
|
||||
if (payload == 'ON') {
|
||||
this.temperature = this.presetTemperature;
|
||||
}
|
||||
@ -64,9 +64,13 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
setTemperature = true;
|
||||
}
|
||||
}
|
||||
else if (topic == MaxThermostat.summerSwitchTopic) {
|
||||
this.summerFlag = (payload == 'ON');
|
||||
logger.info(`${this.itemId} switched to ${this.summerFlag ? 'Summer' : 'Winter'} mode`);
|
||||
else if (topic == MaxThermostat.heatingMainSwitchTopic) {
|
||||
this.heatingMainFlag = (payload == 'ON');
|
||||
logger.info(`${this.itemId} heating main: ${this.heatingMainFlag}`);
|
||||
if (!this.heatingMainFlag) {
|
||||
MqttDispatcher_1.mqttHandler.send(this.temperatureFeedbackTopic, `${DISABLED_TEMPERATURE}`);
|
||||
MqttDispatcher_1.mqttHandler.send(this.actionTopic, `${DISABLED_TEMPERATURE}`);
|
||||
}
|
||||
}
|
||||
else if (topic == this.presetTemperatureTopic) {
|
||||
this.presetTemperature = parseFloat(payload);
|
||||
@ -98,6 +102,6 @@ class MaxThermostat extends AHomegearItem_1.AHomegearItem {
|
||||
}
|
||||
}
|
||||
}
|
||||
MaxThermostat.summerSwitchTopic = 'dispatcher_ng/items/summerSwitch';
|
||||
MaxThermostat.heatingMainSwitchTopic = 'dispatcher_ng/items/heatingMainSwitch';
|
||||
exports.MaxThermostat = MaxThermostat;
|
||||
//# sourceMappingURL=MaxThermostat.js.map
|
Reference in New Issue
Block a user