h4 / lywsd02

MIT License
169 stars 34 forks source link

Set Time fails #11

Closed QuantumSingularity closed 4 years ago

QuantumSingularity commented 4 years ago

I try to set the time, but that doesn't work.

First try: datetime1 = datetime.datetime(2016,4,30,3,20,6) client.time = datetime1 print(client.time[0].strftime("%Y-%m-%d %H:%M:%S")) It displays: 2019-12-15 17:40:17

Second Try: client.time = datetime.datetime.now() # Changes time. Changing timezone offset is not possible print(client.time[0].strftime("%Y-%m-%d %H:%M:%S")) It displays: 2019-12-15 17:40:26

The current time on my debian box was: 2019-12-15 17:42:28

The previous time stays active.

Changing the unit of the humidity works well. client.units = 'C' # Changes temperature units displayed on screen

The info on the back: mac = 'E7:2E:00:13:4C:C0' LYWSD02MMC CMIT ID: 2019DP0124 I've received it this device at the end of previous week.

Updating the time via de Xiaomi App works, but I don't want to be dependant on that app.

QuantumSingularity commented 4 years ago

Hm. I tried the change to year to 2019 and now it works. This is working: datetime1 = datetime.datetime.now() #(2019,4,30,3,20,6) client.time = datetime1

I'm sorry for the call and I'm closing it now.

Thank you for your fantastic work and I'm going to use it.