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 issues with sensors not updating after HA 2024.1 upgrade #37

Merged
merged 12 commits into from
Jan 16, 2024

Conversation

shortbloke
Copy link
Contributor

Fixed #36 - State is directly updated via self._attr_native_value
Address deprecation warnings with specific device and state class combinations used in SENSOR_TYPES definitions.
Use new unit enumerators, replacing deprecated constants, per: Constant Deprecation

@shortbloke shortbloke mentioned this pull request Jan 9, 2024
Copy link
Member

@glpatcern glpatcern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @shortbloke, including all the fixed deprecation warnings. The funny thing is on my side I can't test it right now because my NAS' docker infra (where I deployed HA) needs some care... Anyway, code-wise it all looks fine as per the suggestion we got.

Therefore I think you can close home-assistant/core#107608 and I can merge this one ;) apart a mini-comment I'd add for the story

custom_components/owlintuition/sensor.py Outdated Show resolved Hide resolved
Copy link

@joostlek joostlek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just leaving some unasked review :)

custom_components/owlintuition/owl_intuition.yaml Outdated Show resolved Hide resolved
custom_components/owlintuition/sensor.py Outdated Show resolved Hide resolved
custom_components/owlintuition/sensor.py Outdated Show resolved Hide resolved
@orandaadnaro
Copy link

orandaadnaro commented Jan 11, 2024

I patched and can confirm all is working well

As can be seen below - it didn't ultimately work - I should have given it longer for the app to settle in :-)

@glpatcern
Copy link
Member

Just leaving some unasked review :)

Thanks for the review @joostlek ! And as you now learned about this integration, I dare asking you a suggestion and/or some pointers about a different issue, which is essentially the only reason why I never pushed this to be part of HA core: any idea how to make an async UDP listening loop in the context of HomeAssistant?

@joostlek
Copy link

Let's chat on discord :)

shortbloke and others added 3 commits January 15, 2024 13:19
HA 2024.1.3 caused sensor to break again. This time when trying to set then name attribute. 

Updated to set _attr_name directly during creation of sensor entity.
This is to be consistent with recent changes for name and state.
@glpatcern
Copy link
Member

@shortbloke all good to merge?

@shortbloke
Copy link
Contributor Author

@glpatcern Yep, good to go AFAIK ;-)

@glpatcern glpatcern merged commit b479dc3 into custom-components:master Jan 16, 2024
1 check passed
@orandaadnaro
Copy link

I’m new to all this, but I see you’ve merged some new files into the owl custom setup. Does that mean I will need to re run the terminal script on the customisation page in order to get the new stuff installed?

@shortbloke
Copy link
Contributor Author

@orandaadnaro Assuming you installed this custom component via HACS, the update will be offered there. You might need to restart the HACS addon or HA in order to get to check for updates.

image

@orandaadnaro
Copy link

Thanks that update worked as you described - never seen that before - quite a surprise!

Will future updates come this way?

@shortbloke
Copy link
Contributor Author

@orandaadnaro That's how updates to all HACS components should be delivered. So yes.

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.

Sensors not updating
4 participants