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

Don't reset work profile state on app restart and add "intent only" update type #4765

Merged
merged 4 commits into from
Oct 31, 2024

Conversation

jpelgrom
Copy link
Member

Summary

Closes #4755 by:

  • setting the default tracking value for the work profile sensor to null, and only updating the sensor if the value is not null, so it is not overwritten if we have not received the intent
  • adding a new "intent only" update type for sensors which we cannot read the state for or reliably expect to receive a value in the callback quickly after registering, which mentions in the UI that we need updates from the system and the state may get out of sync

Screenshots

Light Dark
Chip for new update type A chip with the text 'Updates instantly, only on changes', light mode A chip with the text 'Updates instantly, only on changes', dark mode
Dialog text after tapping the chip A dialog with new text 'Note: the sensor can only listen for changes, it cannot get the current state. If the state changes when the device is restarted or while the app is not running, the sensor may not have the correct state.', light mode A dialog with new text 'Note: the sensor can only listen for changes, it cannot get the current state. If the state changes when the device is restarted or while the app is not running, the sensor may not have the correct state.', dark mode

Link to pull request in Documentation repository

n/a

Any other notes

@dshokouhi dshokouhi merged commit 327683d into home-assistant:master Oct 31, 2024
4 checks passed
@jpelgrom jpelgrom deleted the update-type-intent-only branch October 31, 2024 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Work profile sensor not saving state if true and app quits or device is restarted, sensor resets to false
2 participants