Skip to content

v3.0.11 - Date Timezone Fix

Choose a tag to compare

@skircr115 skircr115 released this 28 Feb 19:25
ff4e44c

v3.0.11 — Date Timezone Fix

What's Fixed

Date sensors showing one day early

All date sensors (Last Delivery Date, Next Delivery Date, Last Tank Reading) were displaying one day behind the correct date for users in US timezones.

Root cause: The AmeriGas API returns date-only strings like 01/15/2026 with no time or timezone component. The previous code attached UTC to these naive datetimes before handing them to Home Assistant. When HA converted UTC midnight to local time (e.g. Eastern = UTC−5), the result was 7:00 PM the night before — so the date displayed as January 14 instead of January 15.

Fix: Naive datetimes are now treated as local time by attaching the HA-configured timezone (dt_util.get_default_time_zone()) instead of UTC. Dates display correctly for all timezones.


Next Delivery Date entity disappearing

Some users saw Home Assistant prompt them to delete the Next Delivery Date entity after it became permanently unavailable.

Root cause: v3.0.8 introduced a replace(tzinfo=None) workaround on the next delivery date to prevent the date from shifting. This produced a timezone-naive datetime. SensorDeviceClass.TIMESTAMP requires a timezone-aware value — Home Assistant rejected the naive datetime and eventually dropped the entity from the registry.

Fix: The replace(tzinfo=None) strip is removed entirely. parse_date() now returns a timezone-aware local datetime for all fields, so no post-processing is needed and the sensor stays available.

If the entity was deleted: it will be recreated automatically on the first restart after updating. No manual action required.


Files Changed

File Change
api.py parse_date() uses dt_util.get_default_time_zone() for naive datetimes; removed replace(tzinfo=None) post-processing on next delivery date
manifest.json Version bumped to 3.0.11

How to Update

  1. HACS → Integrations → AmeriGas Propane → Update
  2. Restart Home Assistant

No configuration changes needed. All sensors, automations, and dashboard cards continue working without modification.

What's Changed

Full Changelog: v3.0.10...v3.0.11