Open opape opened 3 years ago
View lywsd03mmc fork. With AtcMiThermometerClient
you can retrieve thermometers data without connecting. Limitations : can't get firmware and hardware revisions, can't get history.
from lywsd03mmc import AtcMiThermometerClient
client = AtcMiThermometerClient()
client.get_datas()
for thermometer in client.thermometers:
print('----\n', thermometer) # print all data `
Result:
Discovered device a4:c1:38:xx:xx:xx
Discovered device a4:c1:38:yy:yy:yy
Device disconnected
Proceed...
Discovered device a4:c1:38:xx:xx:xx
Discovered device a4:c1:38:yy:yy:yy
Received new data from a4:c1:38:xx:xx:xx
----
mac: A4:C1:38:xx:xx:xx - ATC_xxxxxx
temp: 22.8 °C
hum: 37 %
batt: 86 %
volts: 2.98 V
rssi: -54 dB
skip: False
----
mac: A4:C1:38:yy:yy:yy - ATC_yyyyyy
temp: 21.7 °C
hum: 42 %
batt: 88 %
volts: 2.996 V
rssi: -71 dB
skip: False
Please extend the structure SensorDataBattery with the voltage of the battery. The value is already present in the code, but it is not returned in SensorDataBattery.
Thanks