Open theOrakle opened 5 years ago
Thanks for this. The 2021.12 update officially broke all of my timestamp entities that didn't have a timezone, including Plant Gateway's. This helped me resolve manually. Would be nice to see something like this change enter the source.
Add module:
pip3 install python-dateutil
Simply added/modified the following to plantgw.py:
Added import:
from dateutil.tz import tzlocal
Modified
now()
to includetzlocal()
:MQTTAttributes.TIMESTAMP.value: datetime.now(tzlocal()).isoformat(),
data['timestamp'] = datetime.now(tzlocal()).strftime(self.config.mqtt_timestamp_format)