-
-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Miscellaneous ESPHome cleanups #19425
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,11 +43,11 @@ | |
|
|
||
| # The HA component types this integration supports | ||
| HA_COMPONENTS = [ | ||
| 'sensor', | ||
| 'binary_sensor', | ||
| 'cover', | ||
| 'fan', | ||
| 'light', | ||
| 'sensor', | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| 'switch', | ||
| ] | ||
|
|
||
|
|
@@ -461,6 +461,7 @@ async def async_will_remove_from_hass(self): | |
| """Unregister callbacks.""" | ||
| for remove_callback in self._remove_callbacks: | ||
| remove_callback() | ||
| self._remove_callbacks = [] | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
|
|
||
| @property | ||
| def _entry_data(self) -> RuntimeEntryData: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -47,6 +47,11 @@ def icon(self) -> str: | |
| """Return the icon.""" | ||
| return self._static_info.icon | ||
|
|
||
| @property | ||
| def assumed_state(self) -> bool: | ||
| """Return true if we do optimistic updates.""" | ||
| return self._static_info.optimistic | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Switches can also be optimistic in ESPHome (for example template switches without a state lambda). Forgot to include it in the original PR. |
||
|
|
||
| @property | ||
| def is_on(self): | ||
| """Return true if the switch is on.""" | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#19371 (comment)