Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working after HA Core Update 2025/1 #7

Open
jroegner opened this issue Jan 7, 2025 · 3 comments
Open

Not working after HA Core Update 2025/1 #7

jroegner opened this issue Jan 7, 2025 · 3 comments

Comments

@jroegner
Copy link

jroegner commented Jan 7, 2025

Since HA Core Update 2025/1 the integration doesn't anymore:

_Logger: homeassistant.setup
Quelle: setup.py:497
Erstmals aufgetreten: 11:10:48 (1 Vorkommnisse)
Zuletzt protokolliert: 11:10:48

Unable to prepare setup for platform 'remko_heatpump.sensor': Platform not found (cannot import name 'TEMP_CELSIUS' from 'homeassistant.const' (/usr/src/homeassistant/homeassistant/const.py))._

@jroegner
Copy link
Author

jroegner commented Jan 7, 2025

Found a solution. In sensor.py you must change

from homeassistant.const import TEMP_CELSIUS, POWER_KILO_WATT, POWER_WATT
to
from homeassistant.const import UnitOfTemperature, UnitOfPower

and of course also the value of the unit return for each sensor

@Dragancokan
Copy link

What exactly do you mean by: and of course also the value of the unit return for each sensor?

@jroegner
Copy link
Author

jroegner commented Jan 9, 2025

For sensors with unit temperature:
from:

@ property
    def unit_of_measurement(self) -> str:
        """Return the unit of measurement."""
        return TEMP_CELSIUS

to:

@ property
    def unit_of_measurement(self) -> str:
        """Return the unit of measurement."""
        return UnitOfTemperature.CELSIUS

For sensors with unit power
from:

@ property
    def unit_of_measurement(self) -> str:
        """Return the unit of measurement."""
        return POWER_WATT

to:

@ property
    def unit_of_measurement(self) -> str:
        """Return the unit of measurement."""
        return UnitOfPower.WATT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants