enkama / hass-variables

Home Assistant variables component
89 stars 12 forks source link

Make datetime tz aware #103

Closed Snuffy2 closed 9 months ago

Snuffy2 commented 9 months ago

Makes Sensors with Device Class of timestamp timezone aware. This is now required by Home Assistant.

Timestamps must be set as per ISO 8601

Note that if a timestamp is set without a timezone defined, it will be set as UTC.

Example:

service: variable.update_sensor
data:
  replace_attributes: false
  value: "2023-11-20T17:00:00-05:00"
target:
  entity_id: sensor.datetime

Fixes #102