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

Fix: Update deprecated constants to ensure compatibility with Home Assistant 2025.1 #3

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

JOHLC
Copy link

@JOHLC JOHLC commented Feb 5, 2025

I'm not sure if this repository is still actively maintained, and I'm not an expert in Python, but I attempted to fix the issue using ChatGPT. By providing the sensor.py file and the error message, ChatGPT helped me update the deprecated constants.

The following changes were made:

Replaced deprecated constants TEMP_CELSIUS and TIME_SECONDS with the updated UnitOfTemperature.CELSIUS and UnitOfTime.SECONDS respectively.
As a result, I can now restart Home Assistant without errors. The sensors that used to reference TEMP_CELSIUS or TIME_SECONDS are functioning correctly, and there are no log errors after reboot.

Additionally, I updated the strings.json file to adjust the wording to be relevant to HP iLO. However, I'm unsure if the config flow is fully functional.

This should resolve issue #2.

Thanks for your consideration!

JOHLC added 3 commits February 4, 2025 21:12
Removed wording for irrelevant integration and replaced with HP iLO
- Ensured DOMAIN key exists in hass.data.
- Stored entry in hass.data[DOMAIN] to make entry.data accessible.
- Prevented potential KeyError by safely removing entry during unload.
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

Successfully merging this pull request may close these issues.

1 participant