ha-nefiteasy icon indicating copy to clipboard operation
ha-nefiteasy copied to clipboard

Use of deprecated constants

Open AdeZwart opened this issue 1 year ago • 5 comments

Today I've upgraded my home assistant to the latest 2024.1 version and it starts warning about the usage of deprecated constants.

2024-01-04 07:59:05.143 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from nefiteasy, 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/ksya/ha-nefiteasy/issues
2024-01-04 07:59:05.151 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:05.159 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_MEASUREMENT was used from nefiteasy, 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/ksya/ha-nefiteasy/issues
2024-01-04 07:59:05.165 WARNING (MainThread) [homeassistant.components.sensor] STATE_CLASS_TOTAL_INCREASING was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use SensorStateClass.TOTAL_INCREASING instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:05.174 WARNING (MainThread) [homeassistant.const] PRESSURE_BAR was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPressure.BAR instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:05.181 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from nefiteasy, 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/ksya/ha-nefiteasy/issues
2024-01-04 07:59:05.187 WARNING (MainThread) [homeassistant.const] VOLUME_CUBIC_METERS was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfVolume.CUBIC_METERS instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:13.313 WARNING (MainThread) [homeassistant.components.climate.const] CURRENT_HVAC_HEAT was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACAction.HEATING instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:13.320 WARNING (MainThread) [homeassistant.components.climate.const] CURRENT_HVAC_IDLE was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACAction.IDLE instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:13.329 WARNING (MainThread) [homeassistant.components.climate.const] HVAC_MODE_HEAT was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.HEAT instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:13.338 WARNING (MainThread) [homeassistant.components.climate.const] SUPPORT_PRESET_MODE was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.PRESET_MODE instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:13.348 WARNING (MainThread) [homeassistant.components.climate.const] SUPPORT_TARGET_TEMPERATURE was used from nefiteasy, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE instead, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues
2024-01-04 07:59:13.356 WARNING (MainThread) [homeassistant.const] TEMP_CELSIUS was used from nefiteasy, 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/ksya/ha-nefiteasy/issues

The constants will be removed in a year in version 2025.1

AdeZwart avatar Jan 04 '24 08:01 AdeZwart

For what it's worth, here my log:

Logger: homeassistant.helpers.entity Source: helpers/entity.py:1520 First occurred: 13:55:22 (1 occurrences) Last logged: 13:55:22

Entity None (<class 'custom_components.nefiteasy.climate.NefitThermostat'>) is using deprecated supported features values which will be removed in HA Core 2025.1. Instead it should use <ClimateEntityFeature.TARGET_TEMPERATURE|PRESET_MODE: 17>, please create a bug report at https://github.com/ksya/ha-nefiteasy/issues and reference https://developers.home-assistant.io/blog/2023/12/28/support-feature-magic-numbers-deprecation

bschokker avatar Jan 04 '24 13:01 bschokker

Same here obviously

bsimmo avatar Jan 12 '24 10:01 bsimmo

Thanks for pointing it out. That needs an update before 2025.1 (still some time left).

RobBie1221 avatar Jan 12 '24 14:01 RobBie1221

Thanks for pointing it out. That needs an update before 2025.1 (still some time left).

Will an update become available before 2025.1 ?

arjanvdnoort avatar Jul 20 '24 13:07 arjanvdnoort

Yes

RobBie1221 avatar Jul 20 '24 15:07 RobBie1221

Every time i boot HA i get a bunch of NEFIT-errors, and reminds me to Robbie1221. So you are famous.

aeng12 avatar Aug 13 '24 12:08 aeng12

Please test with version 0.4.4 and check if all the warnings are gone (I can't test as I don't have a device anymore). If there are still warnings, please create a new issue and share the logs.

RobBie1221 avatar Aug 14 '24 19:08 RobBie1221

Dear RobBie1221,

I tested 0.4.4 and the warnings are gone after a reboot of HA. Thanks a lot for your support.

bschokker avatar Aug 14 '24 19:08 bschokker

Just upgraded and the warnings in the log are gone. Keeping an eye on it the next couple of days. Thanks Rob!

ChefkeGremmen avatar Aug 15 '24 04:08 ChefkeGremmen

I upgrade to 0.4.4. Works fine. I get only this message in my log 1

aeng12 avatar Aug 15 '24 05:08 aeng12

That one has been there a long time. It can’t hurt and I don’t know how to fix it without completely redesigning the base infrastructure of the integration.

RobBie1221 avatar Aug 15 '24 05:08 RobBie1221

@RobBie1221 Do you actually use stringprep in your code or is it caused by something else like https://community.home-assistant.io/t/has-anyone-else-seen-this-in-their-log-logger-slixmpp-stringprep-using-slower-stringprep-consider-compiling-the-faster-cython-libidn-one/389636/6

mchangsp avatar Aug 15 '24 05:08 mchangsp

I have no clue. It is not used directly by this integration but by slixmpp. Maybe it can’t even be solved here but should be solved upstream…

RobBie1221 avatar Aug 15 '24 06:08 RobBie1221