We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1f9040c commit fc3a74cCopy full SHA for fc3a74c
src/dirigera/hub/hub.py
@@ -343,6 +343,16 @@ def get_scene_by_id(self, scene_id: str) -> Scene:
343
data = self.get(f"/scenes/{scene_id}")
344
return dict_to_scene(data, self)
345
346
+ def get_scene_by_name(self, scene_name: str) -> Scene:
347
+ """
348
+ Fetches all scenes and returns the first result that matches scene_name
349
350
+ scenes = self.get_scenes()
351
+ scenes = list(filter(lambda x: x.info.name == scene_name, scenes))
352
+ if len(scenes) == 0:
353
+ raise AssertionError(f"No Scene found with name {scene_name}")
354
+ return scenes[0]
355
+
356
def get_water_sensors(self) -> List[WaterSensor]:
357
"""
358
Fetches all water sensors registered in the Hub
0 commit comments