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

Hello, is it possible to fix this for next year's version #15

Closed
Thunderbird1982 opened this issue Jan 5, 2024 · 12 comments
Closed

Hello, is it possible to fix this for next year's version #15

Thunderbird1982 opened this issue Jan 5, 2024 · 12 comments

Comments

@Thunderbird1982
Copy link

Logger: homeassistant.const
Source: helpers/deprecation.py:204
First occurred: 13:18:59 (7 occurrences)
Last logged: 13:18:59

POWER_KILO_WATT was used from kostal_piko, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfPower.KILO_WATT
ELECTRIC_POTENTIAL_VOLT was used from kostal_piko, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricPotential.VOLT
TIME_HOURS was used from kostal_piko, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfTime.HOURS

ELECTRIC_CURRENT_AMPERE was used from kostal_piko, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfElectricCurrent.AMPERE

FREQUENCY_HERTZ was used from kostal_piko, this is a deprecated constant which will be removed in HA Core 2025.1. Use UnitOfFrequency.HERTZ

thanks Adrian

@sla89
Copy link
Owner

sla89 commented Jan 5, 2024

Hey, thanks for the report.
For sure, I will fix that 👍

Would it be possivle that you test the chances when I make them?

@patricknitsch
Copy link

Hi,

I got the same log. So if you need somebody to test it, I can support :)

@sla89
Copy link
Owner

sla89 commented Jan 19, 2024

Hi @patricknitsch and @Thunderbird1982

I have created the fix at branch fix_issue_15.

The easiest way to test it is to replace the content of the file const.py - you can find it here: https://github.com/sla89/hassio-kostal-piko/blob/fix_issue_15/custom_components/kostal_piko/const.py

Waiting for your feedback before creating a new release.

Thank you.

@patricknitsch
Copy link

I tested it. I didn't get a warning, but a fault. See my log below.


Logger: homeassistant.loader
Source: loader.py:842
First occurred: 00:29:24 (1 occurrences)
Last logged: 00:29:24

Unexpected exception importing platform custom_components.kostal_piko.sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 859, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/kostal_piko/sensor.py", line 21, in
from .const import (
File "/config/custom_components/kostal_piko/const.py", line 99, in
native_unit_of_measurement=UnitOfElectricCurrent.AMPERE,
^^^^^^^^^^^^^^^^^^^^^
NameError: name 'UnitOfElectricCurrent' is not defined


Is there anything missing?

@sla89
Copy link
Owner

sla89 commented Jan 20, 2024

Ahh forgot to import UnitOfElectricCurrent.

I have updated the const.py file. Can you please give it another try?

Thank you for the fast feedback!

@patricknitsch
Copy link

I added it in my file. "UnitOfEnergy" was also missing. Now it works. I got no error.

@sla89
Copy link
Owner

sla89 commented Jan 20, 2024

Sorry 🙈 I was too tired I guess 🙈 Thank you for testing. I will make the changes in the evening and create a new release

@patricknitsch
Copy link

No Problem. Thank you as well for your work. Glad I could help :)

@sla89
Copy link
Owner

sla89 commented Jan 20, 2024

@patricknitsch can you maybe give the const.py of my branch another try, please? If it is now working I will create the release. Thank you.

@patricknitsch
Copy link

It works now! Good Job!

@sla89 sla89 closed this as completed in 74900d8 Jan 21, 2024
@sla89
Copy link
Owner

sla89 commented Jan 21, 2024

Thank you. Release v1.20 is now available

@Thunderbird1982
Copy link
Author

thank you for the fix works perfect

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

3 participants