smartHomeHub / SmartIR

Integration for Home Assistant to control climate, TV and fan devices via IR/RF controllers (Broadlink, Xiaomi, MQTT, LOOKin, ESPHome)
MIT License
2.05k stars 1.01k forks source link

Soon-to-be-depreciated functionality warnings in 2024.3.0 #1221

Open borez opened 7 months ago

borez commented 7 months ago

Home Assistant version 2024.3.0

SmartIR version 1.17.9

SmartIR configuration


Add configuration here

Describe the bug

Am using the integration to run IR commands for an aircon. Post upgrade to 2024.3.0, I am seeing these warning messages in HA:

Debug log


Logger: homeassistant.components.climate
Source: components/climate/__init__.py:361
integration: Climate ([documentation](https://www.home-assistant.io/integrations/climate), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+climate%22))
First occurred: 8:43:04 PM (3 occurrences)
Last logged: 8:43:04 PM

    Entity None (<class 'custom_components.smartir.climate.SmartIRClimate'>) does not set ClimateEntityFeature.TURN_OFF but implements the turn_off method. Please report it to the author of the 'smartir' custom integration
    Entity None (<class 'custom_components.smartir.climate.SmartIRClimate'>) does not set ClimateEntityFeature.TURN_ON but implements the turn_on method. Please report it to the author of the 'smartir' custom integration
    Entity None (<class 'custom_components.smartir.climate.SmartIRClimate'>) implements HVACMode(s): off, cool, dry, fan_only and therefore implicitly supports the turn_on/turn_off methods without setting the proper ClimateEntityFeature. Please report it to the author of the 'smartir' custom integration

Logger: homeassistant.components.climate.const
Source: helpers/deprecation.py:205
integration: Climate (documentation, issues)
First occurred: 8:42:32 PM (9 occurrences)
Last logged: 8:42:32 PM

HVAC_MODE_FAN_ONLY was used from smartir, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.FAN_ONLY instead, please report it to the author of the 'smartir' custom integration
HVAC_MODE_AUTO was used from smartir, this is a deprecated constant which will be removed in HA Core 2025.1. Use HVACMode.AUTO instead, please report it to the author of the 'smartir' custom integration
SUPPORT_TARGET_TEMPERATURE was used from smartir, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.TARGET_TEMPERATURE instead, please report it to the author of the 'smartir' custom integration
SUPPORT_FAN_MODE was used from smartir, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.FAN_MODE instead, please report it to the author of the 'smartir' custom integration
SUPPORT_SWING_MODE was used from smartir, this is a deprecated constant which will be removed in HA Core 2025.1. Use ClimateEntityFeature.SWING_MODE instead, please report it to the author of the 'smartir' custom integration

Additional context

Add any other context about the problem here.

PeteDenmark commented 7 months ago

Yep - have been seeing those log entries as well, so hoping the developer can fix it before, since my Broadlink would be pretty much useless to me if smart-ir stops working.

Krispkiwi commented 7 months ago

SmartIR doesn't get updated often, I suspect a fork is probably our best bet.

syrusfem commented 7 months ago

Hope there is an update or someone that could do a fork or lots of automation are going to the bin.

zbeez commented 6 months ago

Same here. Yes, hope it'll get sorted.

litinoveweedle commented 6 months ago

Hi, I just pushed PR https://github.com/smartHomeHub/SmartIR/pull/1231 fixing all those warning and errors.

@vassilis-panos Coudl you please review it, merge it and release if suitable? It also seems, that you have many PR pending, mostly related to new added codes. Are you planning to merge those? If you need any help please let me know.

If anyone would like to meanwhile get rid of the errors, you can use my fork from here: https://github.com/litinoveweedle/SmartIR

PeteDenmark commented 6 months ago

Hi, I just pushed PR #1231 fixing all those warning and errors.

@vassilis-panos Coudl you please review it, merge it and release if suitable? It also seems, that you have many PR pending, mostly related to new added codes. Are you planning to merge those? If you need any help please let me know.

If anyone would like to meanwhile get rid of the errors, you can use my fork from here: https://github.com/litinoveweedle/SmartIR

You are a legend. Thank you for your work.

maxperron commented 5 months ago

Hi, I just pushed PR #1231 fixing all those warning and errors.

@vassilis-panos Coudl you please review it, merge it and release if suitable? It also seems, that you have many PR pending, mostly related to new added codes. Are you planning to merge those? If you need any help please let me know.

If anyone would like to meanwhile get rid of the errors, you can use my fork from here: https://github.com/litinoveweedle/SmartIR

Thank you for your work! I have been using your fork, but a new warning appeared unfortunalty, looks like HA is doing a lot of change.

Detected that custom integration 'smartir' calls 'async_track_state_change' instead of 'async_track_state_change_event' which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/smartir/climate.py, line 176: async_track_state_change(self.hass, self._temperature_sensor, please report it to the author of the 'smartir' custom integration • Detected that custom integration 'smartir' calls 'async_track_state_change instead of 'async_track_state_change_event' which is deprecated and will be removed in Home Assistant 2025.5 at custom_components/smartir/climate.py, line 192: async_track_state_change(self.hass, self._power_sensor, please report it to the author of the 'smartir' custom

Krispkiwi commented 5 months ago

Same

litinoveweedle commented 5 months ago

Hello, fixed in PR3 and release in the 1.17.11 in my forked repo.

As @vassilis-panos seem to ignore all my previous PRs, I did not opened PR with this fix against his/this original repo. I have no issue to push it later, if I there will be any sight of activity from his side. Therefore I am afraid you need to use my repo till then.

syrusfem commented 5 months ago

Hello, fixed in PR3 and release in the 1.17.11 in my forked repo.

As @vassilis-panos seem to ignore all my previous PRs, I did not opened PR with this fix against his/this original repo. I have no issue to push it later, if I there will be any sight of activity from his side. Therefore I am afraid you need to use my repo till then.

Hi how do i use your repo in Homeassistant instead of the original ?

litinoveweedle commented 5 months ago

HACS, add custom repo.

agneevX commented 5 months ago

@litinoveweedle please note that the following errors on v1.17.12

2024-05-18 21:20:33.920 ERROR (MainThread) [homeassistant.config] Platform error: climate - cannot import name 'EventStateChangedData' from 'homeassistant.core' (/usr/src/homeassistant/homeassistant/core.py)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 1437, in _async_load_and_validate_platform_integration
platform = await p_integration.integration.async_get_platform(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1070, in async_get_platform
platforms = await self.async_get_platforms((platform_name,))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 1163, in async_get_platforms
platforms[platform_name] = await future
^^^^^^^^^^^^
ImportError: cannot import name 'EventStateChangedData' from 'homeassistant.core' (/usr/src/homeassistant/homeassistant/core.py)
agneevX commented 5 months ago

Fixed by upgrading to latest version of Home Assistant, please ignore.

litinoveweedle commented 5 months ago

Yep, that makes sense, as the warning fix is for the recent HA version. I will check the exact version and put it as a prerequisite for integration into HACS manifest. Although I am pretty sure it is there. Did you by any chance install integration manually?

syrusfem commented 5 months ago

HACS, add custom repo.

Hi adding your repo to the repository won' t reset the originasl smarir configuration right? Or i must reconfigure my smartir devices with the new repo?

vassilis-panos commented 5 months ago

Hi litinoveweedle What exactly is your fork for? And please do not submit it to HACS. There's a reason it hasn't been done all this time

litinoveweedle commented 5 months ago

Hello @vassilis-panos

What exactly is your fork for?

The reason I initially started my fork was because I needed some PR from other users included, PR which you did not merged for long time into your releases. Than I started to fix some recent HA deprecation warnings and also some long pending bugs reported to your repo. I was trying to push my changes to your mainstream, but without response I gave up. To ease maintenance and installation of my fork I therefore started making some less compatible changes now, including own custom HACS repo.

And please do not submit it to HACS. There's a reason it hasn't been done all this time

Any specific reason for that? In the next commit I am going to remove your original functionality for checking and updating integration version directly from github, as well as automatic download of the codes. This is from my perspective redundant to HACS (update of the integration) and potentially less secure dependent (codes download). Codes will be distributes as part of the HACS zip package release.

litinoveweedle commented 5 months ago

HACS, add custom repo.

Hi adding your repo to the repository won' t reset the originasl smarir configuration right? Or i must reconfigure my smartir devices with the new repo?

Test it and you will see. It is easy to make backup of whole HA or just HA configuration. It is just copy paste.

mrahmadt commented 2 months ago

@vassilis-panos any reason you are not accepting PR? I see over 84 PRs pending.

Just need to know your opinion.

litinoveweedle commented 2 months ago

Hey, no need to cry here, just use my fork https://github.com/litinoveweedle/SmartIR

It is kept up to date, just beware of some minor breaking changes. (Just read the docs)