Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Missing TZ in timestamp #38

Open
theOrakle opened this issue Sep 1, 2019 · 1 comment
Open

Missing TZ in timestamp #38

theOrakle opened this issue Sep 1, 2019 · 1 comment

Comments

@theOrakle
Copy link

Add module:

pip3 install python-dateutil

Simply added/modified the following to plantgw.py:

Added import:
from dateutil.tz import tzlocal

Modified now() to include tzlocal():
MQTTAttributes.TIMESTAMP.value: datetime.now(tzlocal()).isoformat(),

data['timestamp'] = datetime.now(tzlocal()).strftime(self.config.mqtt_timestamp_format)

@jonathantidwell
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants