Fix: Update deprecated constants to ensure compatibility with Home Assistant 2025.1 #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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!