Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch LOAD_POWER to float #70

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

YuriyKishchenko
Copy link

Latest Xiaomi firmware is returning LOAD_POWER as float:
{"cmd":"read_ack","model":"plug","sid":"xxxxx","short_id":xxxx,"data":"{\"voltage\":3600,\"status\":\"off\",\"inuse\":\"0\",\"power_consumed\":\"809\",\"load_power\":\"0.00\"}"}

This is causing startup error:

Jul 21 11:09:24 xxx scl: self.parse_data(device['data'])
Jul 21 11:09:24 xxx scl: File "/home/homeassistant/.homeassistant/custom_components/switch/xiaomi.py", line 96, in parse_data
Jul 21 11:09:24 xxx scl: self._load_power = int(data[LOAD_POWER])
Jul 21 11:09:24 xxx scl: ValueError: invalid literal for int() with base 10: '0.00'#033[0m

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant