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

strange value (non-hex) in DEBUG parse data #8

Open
thymjan opened this issue Apr 5, 2020 · 0 comments
Open

strange value (non-hex) in DEBUG parse data #8

thymjan opened this issue Apr 5, 2020 · 0 comments

Comments

@thymjan
Copy link

thymjan commented Apr 5, 2020

Output from demo.py

...
DEBUG:mikettle.mikettle:Parse data: b'\x00\xff\x00\x00PJ\x01\x00\x00\x01\x18\x00'
DEBUG:mikettle.mikettle:data parsed {'action': 'idle', 'mode': 'none', 'set temperature': 80, 'current temperature': 74, 'keep warm type': 'cool down', 'keep warm time': 0}
...

In the fourth byte-data there are non-hex characters.
Must be the data for the temperature, is it?

    def _parse_data(self, data):
        """Parses the byte array returned by the sensor."""
        res = dict()
        res[MI_ACTION] = MI_ACTION_MAP[int(data[0])]
        res[MI_MODE] = MI_MODE_MAP[int(data[1])]
        res[MI_SET_TEMPERATURE] = int(data[4])
        res[MI_CURRENT_TEMPERATURE] = int(data[5])
        res[MI_KW_TYPE] = MI_KW_TYPE_MAP[int(data[6])]
        res[MI_KW_TIME] = MiKettle.bytes_to_int(data[7:8])
        return res
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

No branches or pull requests

1 participant