codyc1515 / ha-contact-energy

Contact Energy integration for Home Assistant
MIT License
10 stars 6 forks source link

Deprecated constant #12

Closed jaymunro closed 4 months ago

jaymunro commented 4 months ago

System Health details

System Information

version core-2024.2.5
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.1
os_name Linux
os_version 6.6.16-haos
arch aarch64
timezone Pacific/Auckland
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1414 Downloaded Repositories | 28
AccuWeather can_reach_server | ok -- | -- remaining_requests | 15
Home Assistant Cloud logged_in | true -- | -- subscription_expiration | February 28, 2025 at 1:00 PM relayer_connected | true relayer_region | ap-southeast-1 remote_enabled | true remote_connected | true alexa_enabled | false google_enabled | true remote_server | ap-southeast-1-2.ui.nabu.casa certificate_status | ready instance_id | 9e5d485dfe6a4b5aa0ce8f48e6ec70f2 can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.0 -- | -- update_channel | stable supervisor_version | supervisor-2024.02.0 agent_version | 1.6.0 docker_version | 24.0.7 disk_total | 28.0 GB disk_used | 19.0 GB healthy | true supported | true board | green supervisor_api | ok version_api | ok installed_addons | Studio Code Server (5.15.0), Whisper (1.0.2), Let's Encrypt (5.0.15), Mosquitto broker (6.4.0), TeslaMate (0.22.0), PostgreSQL (1.0.0), Grafana (9.1.3), Advanced SSH & Web Terminal (17.1.1), Piper (1.5.0), Silicon Labs Multiprotocol (2.4.4), Matter Server (5.2.0), Dnsmasq (1.6.0), openWakeWord (1.10.0), SQLite Web (4.1.2), Music Assistant BETA (2.0.0b106), Glances (0.21.0), ESPHome (2024.2.1)
Dashboards dashboards | 3 -- | -- resources | 11 views | 12 mode | storage
Recorder oldest_recorder_run | February 18, 2024 at 8:40 PM -- | -- current_recorder_run | February 29, 2024 at 7:29 AM estimated_db_size | 1605.62 MiB database_engine | sqlite database_version | 3.44.2
Solcast PV Forecast can_reach_server | ok -- | -- used_requests | 5 rooftop_site_count | 2
Spotify api_endpoint_reachable | ok -- | --

Checklist

Describe the issue

From the log: 2024-02-28 18:34:39.406 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from contact_energy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/codyc15/ha-contact-energy/issues

Reproduction steps

Look in the logs soon after startup

Debug logs

2024-02-29 08:23:53.462 WARNING (SyncWorker_4) [homeassistant.loader] We found a custom integration contact_energy which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-02-29 08:24:15.463 WARNING (MainThread) [homeassistant.const] ENERGY_KILO_WATT_HOUR was used from contact_energy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfEnergy.KILO_WATT_HOUR instead, please create a bug report at https://github.com/codyc15/ha-contact-energy/issues
2024-02-29 08:24:15.782 DEBUG (MainThread) [custom_components.contact_energy.sensor] Setting up sensor(s)...
2024-02-29 08:24:15.797 DEBUG (SyncWorker_0) [custom_components.contact_energy.sensor] Beginning usage update
2024-02-29 08:24:15.798 INFO (SyncWorker_0) [custom_components.contact_energy.sensor] Havent logged in yet, lets login now...
2024-02-29 08:24:17.281 DEBUG (SyncWorker_0) [custom_components.contact_energy.api] Logged in
2024-02-29 08:24:18.072 DEBUG (SyncWorker_0) [custom_components.contact_energy.api] Refreshed session
2024-02-29 08:24:19.065 DEBUG (SyncWorker_0) [custom_components.contact_energy.api] Retrieved accounts
2024-02-29 08:24:19.103 DEBUG (SyncWorker_0) [custom_components.contact_energy.sensor] Fetching usage data
2024-02-29 08:24:28.311 INFO (SyncWorker_0) [custom_components.contact_energy.api] Fetched usage data for 2024/2/27, but got nothing back
2024-02-29 08:24:29.955 INFO (SyncWorker_0) [custom_components.contact_energy.api] Fetched usage data for 2024/2/28, but got nothing back
2024-02-29 08:24:32.963 WARNING (MainThread) [homeassistant.components.sensor] Setup of sensor platform contact_energy is taking over 10 seconds.

Diagnostics dump

No response

jaymunro commented 4 months ago

This seems to have been addressed in #6 already, but the download from HACS seems to be prior to that update.

jaymunro commented 4 months ago

Ah, I think I see the reason. The 1.0.0 tag is the only one still available and is prior to the #6 fix. I presume you're still testing and plan to release an update when ready. I'll wait till then.