Skip to content

Commit e582dff

Browse files
committedFeb 24, 2024
Fix run_command service
1 parent f011b3e commit e582dff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎custom_components/home_connect_alt/services.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
""" Implement the services of this implementation """
2-
from home_connect_async import HomeConnect, HomeConnectError
2+
from home_connect_async import HomeConnect, HomeConnectError, Appliance
33
from homeassistant.core import HomeAssistant
44
from homeassistant.exceptions import HomeAssistantError
55
from homeassistant.helpers import device_registry as dr
@@ -100,13 +100,13 @@ async def async_run_command(self, call) -> None:
100100
appliance = self.get_appliance_from_device_id(data['device_id'])
101101
if appliance:
102102
try:
103-
await appliance.async_run_command(data['key'], data['value'])
103+
await appliance.async_send_command(data['key'], data['value'])
104104
except HomeConnectError as ex:
105105
raise HomeAssistantError(ex.error_description if ex.error_description else ex.msg) from ex
106106
except ValueError as ex:
107107
raise HomeAssistantError(str(ex)) from ex
108108

109-
def get_appliance_from_device_id(self, device_id):
109+
def get_appliance_from_device_id(self, device_id) -> Appliance|None:
110110
""" Helper function to get an appliance from the Home Assistant device_id """
111111
device = self.dr.devices[device_id]
112112
haId = list(device.identifiers)[0][1]

0 commit comments

Comments
 (0)
Please sign in to comment.