Skip to content

Fix telemetry timestamp and update deprecated HA APIs - #48

Open
LukaszP2 wants to merge 1 commit into
markvader:mainfrom
LukaszP2:fix/home-assistant-2026
Open

Fix telemetry timestamp and update deprecated HA APIs#48
LukaszP2 wants to merge 1 commit into
markvader:mainfrom
LukaszP2:fix/home-assistant-2026

Conversation

@LukaszP2

Copy link
Copy Markdown
Contributor

Summary

This PR updates the Sonic integration for newer Home Assistant versions.

Changes

  • Replace the deprecated/removed pytz usage with zoneinfo.ZoneInfo.
  • Handle missing telemetry timestamps safely.
  • Return a timezone-aware datetime from the telemetry timestamp sensor.
  • Use Home Assistant's standard L/min unit for water flow rate.
  • Replace async_timeout with Python's built-in asyncio.timeout.
  • Remove redundant single-task asyncio.gather() calls.
  • Run Sonic device details and telemetry requests concurrently.
  • Fix PropertyEntity.async_update() to refresh the device coordinator.
  • Improve property availability handling.

Problem

After updating Home Assistant, the telemetry timestamp sensor failed with:

NameError: name 'pytz' is not defined

This caused sensor.telemetry_data_timestamp to become unavailable and generated repeated update listener errors.

Testing

Tested on Home Assistant 2026.8.x.

After the fix:

  • Telemetry Data Timestamp is available and updates correctly.
  • Water Flow Rate reports L/min.
  • The previous pytz exception no longer occurs.
  • Integration loads successfully after a full Home Assistant restart.

Compatibility

No changes to the Sonic API or device protocol are required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant