ksya / ha-nefiteasy

Nefit Easy connection for Home Assistant
74 stars 31 forks source link

Use of deprecated constants #288

Closed AdeZwart closed 3 months ago

AdeZwart commented 11 months ago

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

bschokker commented 11 months ago

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

bsimmo commented 10 months ago

Same here obviously

RobBie1221 commented 10 months ago

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

arjanvdnoort commented 4 months ago

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

Will an update become available before 2025.1 ?

RobBie1221 commented 4 months ago

Yes

aeng12 commented 3 months ago

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

RobBie1221 commented 3 months ago

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.

bschokker commented 3 months ago

Dear RobBie1221,

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

ChefkeGremmen commented 3 months ago

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

aeng12 commented 3 months ago

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

RobBie1221 commented 3 months ago

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.

mchangsp commented 3 months ago

@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

RobBie1221 commented 3 months ago

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…