Skip to content

Commit

Permalink
Fix triggers and action when using meta integrations (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
SukramJ authored Jul 18, 2024
1 parent 3d219dd commit adf894a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
3 changes: 2 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Version 1.64.0 (2024-07-02)

- Remove service delete_device. Use delete on the device entry instead.
- Remove service delete_device. Use delete on the device entry instead
- Fix triggers and action when using meta integrations

# Version 1.63.1 (2024-06-22)

Expand Down
9 changes: 6 additions & 3 deletions custom_components/homematicip_local/device_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ async def async_get_actions(hass: HomeAssistant, device_id: str) -> list[dict[st
device_address, interface_id = data
actions = []
for entry_id in device.config_entries:
if entry := hass.config_entries.async_get_entry(entry_id=entry_id):
if (
entry := hass.config_entries.async_get_entry(entry_id=entry_id)
) and entry.domain == DOMAIN:
control_unit: ControlUnit = entry.runtime_data
if control_unit.central.has_client(interface_id=interface_id) is False:
continue
Expand Down Expand Up @@ -88,9 +90,10 @@ async def async_call_action_from_config(

device_address, interface_id = data
for entry_id in device.config_entries:
if entry := hass.config_entries.async_get_entry(entry_id=entry_id):
if (
entry := hass.config_entries.async_get_entry(entry_id=entry_id)
) and entry.domain == DOMAIN:
control_unit: ControlUnit = entry.runtime_data

if control_unit.central.has_client(interface_id=interface_id) is False:
continue
if hm_device := control_unit.central.get_device(address=device_address):
Expand Down
4 changes: 3 additions & 1 deletion custom_components/homematicip_local/device_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ async def async_get_triggers(hass: HomeAssistant, device_id: str) -> list[dict[s
device_address, interface_id = data
triggers = []
for entry_id in device.config_entries:
if entry := hass.config_entries.async_get_entry(entry_id=entry_id):
if (
entry := hass.config_entries.async_get_entry(entry_id=entry_id)
) and entry.domain == DOMAIN:
control_unit: ControlUnit = entry.runtime_data
if control_unit.central.has_client(interface_id=interface_id) is False:
continue
Expand Down

0 comments on commit adf894a

Please sign in to comment.