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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sensors when driving interface is open or resumed #3726

Merged
merged 2 commits into from
Jul 28, 2023

Conversation

dshokouhi
Copy link
Member

Summary

Update sensors when the driving interface is open/resumed.

There really is no onResume method so need to use a separate launch method with the lifecycle set to resumed. Attempted to use this when the screen is created but that only gets called once and not on resume. Also attempting to move the method to onGetTemplates triggers the intent twice so this seemed the best fit.

This also matches existing behavior in the main/wear app

This should help users see updates from car sensors too 馃 (for whoever they actually work for 馃槀 )

Screenshots

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#

Any other notes

@jpelgrom
Copy link
Member

Shouldn't this use SensorReceiver.updateAllSensors(context) instead of SensorUpdateReceiver.updateSensors(context)?

@dshokouhi
Copy link
Member Author

Shouldn't this use SensorReceiver.updateAllSensors(context) instead of SensorUpdateReceiver.updateSensors(context)?

too many update commands 馃檲

@jpelgrom
Copy link
Member

I'm not completely sure what the difference is but the updateAllSensors one is used for main/wear at least

@dshokouhi
Copy link
Member Author

I'm not completely sure what the difference is but the updateAllSensors one is used for main/wear at least

its because we couldnt use SensorReceiver inside of common

@JBassett JBassett merged commit d33bdf4 into home-assistant:master Jul 28, 2023
4 checks passed
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.

None yet

3 participants