diff --git a/__simulation__/devices.py b/__simulation__/devices.py index b57c327..11df954 100644 --- a/__simulation__/devices.py +++ b/__simulation__/devices.py @@ -1,6 +1,5 @@ import colored import json -import sys import task import time diff --git a/function/first_floor_east.py b/function/first_floor_east.py index de7df16..444380f 100644 --- a/function/first_floor_east.py +++ b/function/first_floor_east.py @@ -198,7 +198,7 @@ class first_floor_east_sleep(room): # heating self.gui_heating = devices.nodered_gui_radiator(mqtt_client, config.TOPIC_FFE_SLEEP_HEATING_VALVE_GUI) - self.heating_function.add_callback(heating_function.KEY_TEMPERATURE_SETPOINT, None, self.gui_heating.set_temperature_mcb, True) + self.heating_function.add_callback(heating_function.KEY_TEMPERATURE_CURRENT, None, self.gui_heating.set_temperature_mcb, True) def set_heating_setpoint(device, key, data): self.heating_function.set(heating_function.KEY_USER_TEMPERATURE_SETPOINT, data) diff --git a/function/first_floor_west.py b/function/first_floor_west.py index 2798a52..1225160 100644 --- a/function/first_floor_west.py +++ b/function/first_floor_west.py @@ -65,7 +65,7 @@ class first_floor_west_bath(room): ##### TEMPORARY ################################################################################################################### self.gui_heating = devices.nodered_gui_radiator(mqtt_client, config.TOPIC_FFW_BATH_HEATING_VALVE_GUI) - self.heating_function.add_callback(heating_function.KEY_TEMPERATURE_SETPOINT, None, self.gui_heating.set_temperature_mcb, True) + self.heating_function.add_callback(heating_function.KEY_TEMPERATURE_CURRENT, None, self.gui_heating.set_temperature_mcb, True) def set_heating_setpoint(device, key, data): self.heating_function.set(heating_function.KEY_USER_TEMPERATURE_SETPOINT, data) diff --git a/function/ground_floor_west.py b/function/ground_floor_west.py index 62ef37b..4e26106 100644 --- a/function/ground_floor_west.py +++ b/function/ground_floor_west.py @@ -81,7 +81,7 @@ class ground_floor_west_marion(room): self.main_light_shelly.add_callback(devices.shelly.KEY_OUTPUT_0, None, self.gui_main_light.set_state_mcb) self.gui_heating = devices.nodered_gui_radiator(mqtt_client, config.TOPIC_GFW_MARION_HEATING_VALVE_GUI) - self.heating_function.add_callback(heating_function.KEY_TEMPERATURE_SETPOINT, None, self.gui_heating.set_temperature_mcb, True) + self.heating_function.add_callback(heating_function.KEY_TEMPERATURE_CURRENT, None, self.gui_heating.set_temperature_mcb, True) def set_heating_setpoint(device, key, data): self.heating_function.set(heating_function.KEY_USER_TEMPERATURE_SETPOINT, data) @@ -225,6 +225,7 @@ class ground_floor_west_dirk(room): self.powerplug_common.add_callback(self.KEY_POWERPLUG_PC_DOCK, None, self.gui_pc_dock.set_state_mcb) self.gui_heating = devices.nodered_gui_radiator(mqtt_client, config.TOPIC_GFW_DIRK_HEATING_VALVE_GUI) + self.heating_function.add_callback(heating_function.KEY_TEMPERATURE_CURRENT, None, self.gui_heating.set_temperature_mcb, True) def set_heating_setpoint(device, key, data): self.heating_function.set(heating_function.KEY_USER_TEMPERATURE_SETPOINT, data) @@ -294,7 +295,6 @@ class ground_floor_west_dirk(room): mqtt_client, config.TOPIC_GFW_DIRK_ACTIVE_BRIGHTNESS_DEVICE_VIDEV, brightness_choose_n_action.KEY_ACTIVE_DEVICE, self.brightness_functions, 3 ) - # # Other stuff # diff --git a/function/videv.py b/function/videv.py index e9e45ce..702e2f3 100644 --- a/function/videv.py +++ b/function/videv.py @@ -234,13 +234,13 @@ class videv_heating(base_routing): class videv_multistate(base): - def __init__(self, mqtt_client, topic, key, device, num_states, default_values=None): + def __init__(self, mqtt_client, topic, key_for_topic, device, num_states, default_values=None): dv = dict.fromkeys(["state_%d" % i for i in range(0, num_states)]) for key in dv: dv[key] = False - super().__init__(mqtt_client, topic, (key, device), default_values=dv) + super().__init__(mqtt_client, topic, (key_for_topic, device), default_values=dv) # - device.add_callback(key, None, self.__index_rx__, True) + device.add_callback(key_for_topic, None, self.__index_rx__, True) def __index_rx__(self, device, key, data): for index, key in enumerate(self):