Skip to content

Miscellaneous ESPHome cleanups#19425

Merged
MartinHjelmare merged 1 commit intohome-assistant:devfrom
OttoWinter:esphome-cleanup
Dec 18, 2018
Merged

Miscellaneous ESPHome cleanups#19425
MartinHjelmare merged 1 commit intohome-assistant:devfrom
OttoWinter:esphome-cleanup

Conversation

@OttoWinter
Copy link
Copy Markdown
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.

if self._static_info.is_status_binary_sensor:
return True
return super(EsphomeEntity, self).available
return super().available
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

"""Unregister callbacks."""
for remove_callback in self._remove_callbacks:
remove_callback()
self._remove_callbacks = []
Copy link
Copy Markdown
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
Copy Markdown
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