feat(entity): add connection status binary sensor to provide feedback in case of a disconnection #151
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.
Related Issues
Proposed Changes:
This change adds a binary sensor as a feedback mechanism in case the device is not connected to the Cloud API. You can use it to know if the state that you see is up to date, to trigger automations, to send notifications.
Example:
![image](https://private-user-images.githubusercontent.com/1560405/309291165-fed5ef2c-127e-432b-9652-efaf5e8bc99e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkwNTEyNTEsIm5iZiI6MTczOTA1MDk1MSwicGF0aCI6Ii8xNTYwNDA1LzMwOTI5MTE2NS1mZWQ1ZWYyYy0xMjdlLTQzMmItOTY1Mi1lZmFmNWU4YmM5OWUucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIwOCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMDhUMjE0MjMxWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDA0YzFlY2QxOGYwZWJhMGNhYTJmZTQxM2IyMjc0Y2UwN2Y3NzE2YWRmNDVhYzdmYjgxODQ2ZmRhNmM1YjM4NCZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.qKUdJ0QjkcRMJtpB4hr58G0rsGWswWYI9rCE6tlNrz8)
Testing:
off
in case of connection.Extra Notes (optional):
This is a follow-up PR for #148. With both changes, we keep the previous state in case of disconnection to avoid triggering unwanted automations, but at the same time we provide a good feedback mechanism.
Checklist