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

POWER_WATT was used from currentcost, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead #25

Open
vw-kombi opened this issue Jan 21, 2024 · 5 comments

Comments

@vw-kombi
Copy link


name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''


Describe the bug
2024-01-21 13:12:17.417 WARNING (MainThread) [homeassistant.const] POWER_WATT was used from currentcost, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.WATT instead, please create a bug report at https://github.com/lolouk44/CurrentCost_HA_CC/issues

To Reproduce
restart HA - warning from the core relating to this.

Expected behaviour
no warning on startup

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop/Server/Device (please complete the following information):

  • Device used to run the Custom Component [e.g. Raspberry Pi, NUC]
  • Method of installation [e.g. via HACS or manual]
  • Version of the Custom Component installed?
  • Model of the Current Cost Device

Additional context
Add any other context about the problem here.

Logs
Please set the Current Cost Custom Component's logging level to debug and provide relevant logs section from Home-Assistant.
To Enable debug logging level, add this to your configuration.yaml and restart:

logger:
  default: error
  logs:
    custom_components.currentcost: debug
@Majestic7979
Copy link

Hi @lolouk44 I hope you're doing well. I am not tagging you to rush you. Just wanted to say I was about to post the same issue, saw this. I have it too. The sensor is no longer reporting the watts, I've lost monitoring. The serial device is still showing in /dev/serial/by-id folder and it's mounted to the HA container just as before.

@snarby2013
Copy link

Hi, I edited sensor.py in custom_components/currentcost changing POWER_WATT at the end of line 11 to UnitOfPower, like this

from homeassistant.const import CONF_NAME, CONF_UNIQUE_ID, CONF_DEVICES, EVENT_HOMEASSISTANT_STOP, UnitOfPower

and also changed line 62 POWER_WATT to UnitOfPower.WATT and it has fixed the error

self._unit = UnitOfPower.WATT

@vw-kombi
Copy link
Author

UnitOfPower

That seems to have fixed this for me - Thanks.

@tranbert
Copy link

Good shot, thank you !

@gildas33
Copy link

Thank you for the fix!!!

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

5 participants