ratcashdev / mitemp

Xiaomi MI Temperature and Humidity Sensor with BLE and LCD
MIT License
106 stars 27 forks source link

Mac Adress range check in demo.py #9

Closed sgoudsme closed 5 years ago

sgoudsme commented 5 years ago

Hi,

I just tested your code with my Xiaomi Temperature and Humidity sensor. The first time I ran this script, I got the error "argument mac: The MAC address "58:2d:34:31:9a:b8" seems to be in the wrong format" But when I uncomment this line, I just got the right data. I don't know why there is a check on the "4c:65:A8:...." range, but the "58:2d:34..." range works just fine too.

I changed the "raise exception..." to a regular "print ..." and got the following output:

./demo.py --backend bluepy poll 58:2d:34:31:9a:b8 The MAC address "58:2d:34:31:9a:b8" seems to be in the wrong format Getting data from Mi Temperature and Humidity Sensor FW: 00.00.66 Name: MJ_HT_V1 Battery: 100 Temperature: 20.0 Humidity: 54.0

mtoensing commented 5 years ago

Yes, I made the same experience. Can someone change the regex?

ratcashdev commented 5 years ago

fixed in latest master.