Bug-Fix: current cemperature heating + brightness device selection in videv

This commit is contained in:
Dirk Alders 2023-01-25 11:17:29 +01:00
vanhempi 4ddc871aa1
commit 9d550f1b04
5 muutettua tiedostoa jossa 7 lisäystä ja 8 poistoa

Näytä tiedosto

@ -1,6 +1,5 @@
import colored
import json
import sys
import task
import time

Näytä tiedosto

@ -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)

Näytä tiedosto

@ -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)

Näytä tiedosto

@ -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
#

Näytä tiedosto

@ -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):