Просмотр исходного кода

fix(services): make py match yaml naming

Different name was used, which made parameter appear as None even when chosen
Jason Rumney 3 недель назад
Родитель
Сommit
5be9441b43
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      custom_components/tuya_local/services.py

+ 2 - 2
custom_components/tuya_local/services.py

@@ -50,7 +50,7 @@ async def async_handle_send_ir_command(entity, call: ServiceCall):
     if not entity._storage_loaded:
         await entity._async_load_storage()
 
-    emitter = call.data.get("emitter")
+    emitter = call.data.get("emitter_entity_id")
     device = call.data.get("device")
     command = call.data.get("command")
     delay = call.data.get(ATTR_DELAY_SECS, DEFAULT_DELAY_SECS)
@@ -70,7 +70,7 @@ async def async_handle_send_ir_command(entity, call: ServiceCall):
             _LOGGER.error("RF emitters are not yet supported by this service")
             continue
         await infrared.async_send_command(
-            entity.hass, emitter.entity_id, TuyaRemoteCommand(code=code)
+            entity.hass, emitter, TuyaRemoteCommand(code=code)
         )
         at_least_one_sent = True