sinricpro / python-sdk

python3 sdk for sinric pro.
https://sinric.pro
23 stars 9 forks source link

Switch with Dimming Python None issue #21

Closed jeimison3 closed 4 years ago

jeimison3 commented 4 years ago

Starting from this request or setting enable_log=True on SinricPro class, I found in file "_powerLevelController.py" in line 18 the following:

jsn.get("payload").get("powerLevel")

It's causing powerLevel None on event setPowerLevel, because powerLevel is inside "value" dict. The solution is insert .get("value") in the middle, getting as follows:

self.power_level = jsn.get("payload").get("value").get("powerLevel")

thegoliathgeek commented 4 years ago

@jeimison3 Thank you. I'll correct it. Or it would help me if you raise a pull request correcting it.

jeimison3 commented 4 years ago

@jeimison3 Thank you. I'll correct it. Or it would help me if you raise a pull request correcting it.

Yes, I will.