myTselection / telenet_telemeter

Telenet Telemeter Home Assistant custom component HACS for Belgian ISP and mobile phone network traffic.
MIT License
31 stars 7 forks source link

Update on phone format #40

Closed lantranbot closed 11 months ago

lantranbot commented 11 months ago

Hi, Thanks for your update on the telenet phone numbers. However, I'm still seeing an error in my logs :

2023-12-31 15:18:48.252 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.telenet_telemeter_mobile_04xxxxxxxx fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 698, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 959, in async_device_update await self.async_update() File "/config/custom_components/telenet_telemeter/sensor.py", line 1244, in async_update original_datetime = datetime.strptime(self._period_end_date, _TELENET_DATETIME_FORMAT) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/_strptime.py", line 568, in _strptime_datetime tt, fraction, gmtoff_fraction = _strptime(data_string, format) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/_strptime.py", line 349, in _strptime raise ValueError("time data %r does not match format %r" % ValueError: time data '2024-01-05T00:00:00+01:00' does not match format '%Y-%m-%dT%H:%M:%S.0%z'

It seems the time zone is not updated for some reason. Could you have another look please? Thanks!