travisghansen / hass-opnsense

OPNsense integration with Home Assistant
214 stars 29 forks source link

2024.1 log errors - deprecated constants which will be removed in HA Core 2025.1 #111

Closed circa1665 closed 1 month ago

circa1665 commented 9 months ago
Logger: homeassistant.components.sensor
Source: helpers/deprecation.py:204
Integration: Sensor (documentation, issues)
First occurred: 4 January 2024 at 06:19:55 (4 occurrences)
Last logged: 4 January 2024 at 06:20:01

STATE_CLASS_MEASUREMENT was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.MEASUREMENT instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues
Logger: homeassistant.const
Source: helpers/deprecation.py:204
First occurred: 4 January 2024 at 06:19:35 (9 occurrences)
Last logged: 4 January 2024 at 06:20:01

FREQUENCY_HERTZ was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfFrequency.HERTZ instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues
TEMP_CELSIUS was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTemperature.CELSIUS instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues
TIME_SECONDS was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.SECONDS instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues
DATA_RATE_KILOBYTES_PER_SECOND was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfDataRate.KILOBYTES_PER_SECOND instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues
TIME_MILLISECONDS was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.MILLISECONDS instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues
alexdelprete commented 9 months ago

I submitted PR #112, but I don't know when Travis will be able to merge it. Since I haven't been able to test it yet, I zipped the two changed files in this archive: hass-opnsense-2024.1-patch-v2.zip

If you can test it, it would be awesome. Simply rename the original files and unpack the zip in the component's folder, then restart HA.

Let me know how it goes...:)

(UPDATED with patch v2)

circa1665 commented 9 months ago

Hey! Thank you, have added the patched files and am no longer seeing those errors in the logs - all appears to be working fine 👍

alexdelprete commented 9 months ago

Thanks for reporting back.

@travisghansen: PR #112 seems to be working fine.

robvanoostenrijk commented 9 months ago

@alexdelprete,

Thanks for sending the above patch. I've tested the files you attached. Two messages still remain after updating:

[homeassistant.const] DATA_BYTES was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfInformation.BYTES instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues

[homeassistant.components.device_tracker] SOURCE_TYPE_ROUTER was used from opnsense, this is a deprecated constant which will be removed in HA Core 2025.1. Use SourceType.ROUTER instead, please create a bug report at https://github.com/travisghansen/hass-opnsense/issues`
alexdelprete commented 9 months ago

Two messages still remain after updating:

Yes, if you check the PR, I had already updated #112 with that too, but I didn't attach the updated files here: hass-opnsense-2024.1-patch-v2.zip

I also updated the previous post with patch v2.

Sorry for that.