Upgrade aioesphomeapi to 2.7.0 (#50522)

pull/50531/head
Franck Nijhof 2021-05-12 15:21:54 +02:00 committed by GitHub
parent 6ef3de464c
commit 72f342aa5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -146,16 +146,18 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if new_state is None:
return
entity_id = event.data.get("entity_id")
await cli.send_home_assistant_state(entity_id, new_state.state)
await cli.send_home_assistant_state(entity_id, None, new_state.state)
async def _send_home_assistant_state(
entity_id: str, new_state: State | None
) -> None:
"""Forward Home Assistant states to ESPHome."""
await cli.send_home_assistant_state(entity_id, new_state.state)
await cli.send_home_assistant_state(entity_id, None, new_state.state)
@callback
def async_on_state_subscription(entity_id: str) -> None:
def async_on_state_subscription(
entity_id: str, attribute: str | None = None
) -> None:
"""Subscribe and forward states for requested entities."""
unsub = async_track_state_change_event(
hass, [entity_id], send_home_assistant_state_event

View File

@ -3,7 +3,7 @@
"name": "ESPHome",
"config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/esphome",
"requirements": ["aioesphomeapi==2.6.6"],
"requirements": ["aioesphomeapi==2.7.0"],
"zeroconf": ["_esphomelib._tcp.local."],
"codeowners": ["@OttoWinter"],
"after_dependencies": ["zeroconf", "tag"],

View File

@ -160,7 +160,7 @@ aioeafm==0.1.2
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==2.6.6
aioesphomeapi==2.7.0
# homeassistant.components.flo
aioflo==0.4.1

View File

@ -100,7 +100,7 @@ aioeafm==0.1.2
aioemonitor==1.0.5
# homeassistant.components.esphome
aioesphomeapi==2.6.6
aioesphomeapi==2.7.0
# homeassistant.components.flo
aioflo==0.4.1