Add option to update camera & template tile when 'in view' #4185
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.
Summary
Implements #4007: use the
onTileEnterEvent
callback to request an update to the tile once it enters the view. Considering that this callback exists it's probably safe to assume an update that is requested in this callback won't be throttled (at least it appears to work during testing).Includes a minor edit to the refresh interval picker to ensure strings that are more than one line look a bit nicer - originally the string I used was 2 lines but I made it shorter to fit in one instead.
Screenshots
Setting:
![Refresh interval picker with the option 'On view' centered](https://private-user-images.githubusercontent.com/8148535/301968106-15e1c15a-b83c-435f-a3db-da9f96c2d5b8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzg4OTM1ODIsIm5iZiI6MTczODg5MzI4MiwicGF0aCI6Ii84MTQ4NTM1LzMwMTk2ODEwNi0xNWUxYzE1YS1iODNjLTQzNWYtYTNkYi1kYTlmOTZjMmQ1YjgucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwNyUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDdUMDE1NDQyWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MjExZjE0ODFiYmQ1YmVmNjg2YTZmNzAxNzBlZGRjZTcwYjAzMTdiM2YwMDAxODhlYjUzZTJkZGMwOTAxMTEwYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.k6PMLGFkETNKIhNdQC5L2VrV8Hkzqc74k9vRyLpKTag)
Demo video:
PXL_20240202_203035614.TS.-.Trim.mp4
('On view' was changed to 'In view' after taking the screenshot and video)
Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#1029
Any other notes