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

Miscellaneous ESPHome cleanups #19425

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

OttoWinter
Copy link
Member

Description:

See comments

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

@@ -60,4 +60,4 @@ def available(self):
"""Return True if entity is available."""
if self._static_info.is_status_binary_sensor:
return True
return super(EsphomeEntity, self).available
return super().available
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'binary_sensor',
'cover',
'fan',
'light',
'sensor',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -461,6 +461,7 @@ def __init__(self, entry_id: str, component_key: str, key: int):
"""Unregister callbacks."""
for remove_callback in self._remove_callbacks:
remove_callback()
self._remove_callbacks = []
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't know that async_will_remove behaves this way (see #19414) - this fixes the same thing as in #19414

@property
def assumed_state(self) -> bool:
"""Return true if we do optimistic updates."""
return self._static_info.optimistic
Copy link
Member Author

Choose a reason for hiding this comment

The 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.

@MartinHjelmare MartinHjelmare merged commit 7317b1b into home-assistant:dev Dec 18, 2018
@ghost ghost removed the in progress label Dec 18, 2018
@OttoWinter OttoWinter deleted the esphome-cleanup branch December 18, 2018 18:05
dshokouhi pushed a commit to dshokouhi/home-assistant that referenced this pull request Dec 25, 2018
@balloob balloob mentioned this pull request Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants