djtimca / haomnilogic

Hayward Omnilogic integration for Home Assistant available through HACS
Apache License 2.0
18 stars 6 forks source link

Add Instant Salt sensor, opt in to long term statistics, update sync_setup_setups due to deprecation, implement change to login credentials #43

Closed twillux closed 1 year ago

twillux commented 1 year ago

Proposed change

Rename previous Salt Level sensor to Average Salt Level and add new sensor for Instant Salt Level as the Hayward API does expose this in the returned telemetry.

Add note to Readme that sensors should not be renamed within the Omnilogic controller configuration.

Removed '(not email)' string from Username prompt, as email addresses are possible for credentials.

Update waiting for config entry platform: before 2022.8, it was impossible to await config entry platforms forwards without a deadlock if one of the platforms loaded by the config entry was not already loaded. Replaced async_setup_platforms with await async_forward_entry_setups, as the former will be removed in 2023.3. https://developers.home-assistant.io/blog/2022/07/08/config_entry_forwards/

Add STATE_CLASS to all measurement sensors to enable long term statistics in HA.

Add Username and Password login credentials to integration Options config flow. This allows changing of Hayward Omnilogic login credentials without having to delete and reinstall integration. To maintain compatibility with existing integrations, write both credential data and options data to both Data and Options config entries. Bound pH Offset to -14 to +14.

Breaking change

Existing integrations will have their Salt Level Sensor orphaned and replaced with the two new sensors, Average Salt Level and Instant Salt Level

Type of change

Additional information

Checklist

Note that this is my first PR; apologies if anything is incorrect or I didn't follow proper etiquette!