File tree 1 file changed +3
-3
lines changed
custom_components/home_connect_alt
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 1
1
""" Implement the services of this implementation """
2
- from home_connect_async import HomeConnect , HomeConnectError
2
+ from home_connect_async import HomeConnect , HomeConnectError , Appliance
3
3
from homeassistant .core import HomeAssistant
4
4
from homeassistant .exceptions import HomeAssistantError
5
5
from homeassistant .helpers import device_registry as dr
@@ -100,13 +100,13 @@ async def async_run_command(self, call) -> None:
100
100
appliance = self .get_appliance_from_device_id (data ['device_id' ])
101
101
if appliance :
102
102
try :
103
- await appliance .async_run_command (data ['key' ], data ['value' ])
103
+ await appliance .async_send_command (data ['key' ], data ['value' ])
104
104
except HomeConnectError as ex :
105
105
raise HomeAssistantError (ex .error_description if ex .error_description else ex .msg ) from ex
106
106
except ValueError as ex :
107
107
raise HomeAssistantError (str (ex )) from ex
108
108
109
- def get_appliance_from_device_id (self , device_id ):
109
+ def get_appliance_from_device_id (self , device_id ) -> Appliance | None :
110
110
""" Helper function to get an appliance from the Home Assistant device_id """
111
111
device = self .dr .devices [device_id ]
112
112
haId = list (device .identifiers )[0 ][1 ]
You can’t perform that action at this time.
0 commit comments