Closed xgustavoh closed 1 year ago
Thanks @xgustavoh ! I'll run some tests to verify
@uzlonewolf can you take a look as well?
I like the idea, though I think creating a new dict just to update another is kinda convoluted. How about replacing
if data is not None and "dps" in data:
data["dps"] = {k: None for k in data["dps"]}
self.dps_cache.update(data["dps"])
with:
if data is not None and "dps" in data:
# save the keys but not the returned values
for k in data["dps"]:
self.dps_cache[k] = None
I like your way too, it even had implementation that way... But, I'm not a python programmer, so I don't know the best practices, I'm going to change right now!
Thank you @xgustavoh !! My tests are passing. I'll release it as v1.12.7.
Hello, first I would like to apologize for my English!
Recently I had a problem using a Smart Bulb RGBCW7 in
version = 3.2
, that it was turning off or changing its status "randomly".I noticed that whenever the
status()
function was executed, the bulb suffered a "reset" or "turning off".After seeing the code, I noticed that the
dps_cache
was exactly to the value that the bulb was getting after the "reset".When I set the
dps_to_request
values to `None, the problem didn't happen.Adding this code in
def detect_available_dps(self):
solved my problem.