Limych / ha-iaquk

Indoor Air Quality Sensor Component for Home Assistant
MIT License
105 stars 15 forks source link

homeassistant.util.temperature is deprecated, need to remove convert usage #126

Closed elad-bar closed 6 months ago

elad-bar commented 10 months ago

Checklist

Is your feature request related to a problem? Please describe.

Effective 2023.11.x - homeassistant.util.temperature will be deprecated, working with RC version leads to integration loading failure

Describe the solution you'd like

HA knows how to handle unit conversion using the UI, it seems like redundant functionality - Line 356, 357 in init.py

Describe alternatives you've considered

no other option

Additional context

link to functionality deprecation commit: https://github.com/home-assistant/core/commit/8626a4888c735d66f85cb78b6dfe042c2061065c

McGiverGim commented 10 months ago

I can confirm the issue with the version of HA released today.

billmaterial commented 10 months ago

I have implemented a quick workaround for this issue until the official fix is implemented.

  1. Copy "temperature.py" to the "custom_components > iaquk" folder (I downloaded one from Github from the utils folder).
  2. Change line 12 of "temperature.py" from "from .unit_conversion import TemperatureConverter" to "from homeassistant.util.unit_conversion import TemperatureConverter".
  3. Edit "init.py" and change line 30 to "from .temperature import convert as convert_temperature".
  4. Check config and restart.

That has got it working again for me. iaquk-temp-fix.zip

elad-bar commented 10 months ago

I've done something similar, Removed the import and the usage of it, mainly because it's should noy handle the conversion by component as this is out of the box capability

cinghialino commented 9 months ago

is this project abandoned? Has the author been drafted? Hopefully they're fine.

AlexL00 commented 9 months ago

is this project abandoned? Has the author been drafted? Hopefully they're fine.

The author @Limych seems to be active in another project 4 days ago. So at least we know they're still there :)