Open sapdemon opened 2 years ago
after code update my lights behave strange - turning on two lights in the same time gives only one light flashing, but after turning another light (third one) missing one start to flash. I am not sure, but probably issue opened by sapdemon have connection with my problem.
Home Assistant 2021.11.1 Component Version 0.1.4
The logs: 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX state restored: 1 <- 13 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX entity brightness restored: 1 <- 13 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX state restored: 2 <- 13 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX entity brightness restored: 2 <- 13 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX state restored: 3 <- 13 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX entity brightness restored: 3 <- 13 .... 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX state restored: 1 <- 133 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX entity brightness restored: 1 <- 0 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX state restored: 2 <- 164 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX entity brightness restored: 2 <- 0 .... 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX state restored: 10 <- 255 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX entity brightness restored: 10 <- 0 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX state restored: 11 <- 255 2021-11-10 18:41:36 DEBUG (MainThread) [custom_components.dmx.light] DMX entity brightness restored: 11 <- 0
So if the light had OFF state before restarting HA it does not take it into consideration during the restore previous status of the entity and set restored dmx_values for this light.
It seems there is a bug in async def async_added_to_hass(self) -> None: