dirigera 1.3.0__tar.gz → 1.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dirigera-1.3.0/src/dirigera.egg-info → dirigera-1.3.1}/PKG-INFO +3 -3
- {dirigera-1.3.0 → dirigera-1.3.1}/pyproject.toml +3 -3
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/scene.py +1 -0
- {dirigera-1.3.0 → dirigera-1.3.1/src/dirigera.egg-info}/PKG-INFO +3 -3
- dirigera-1.3.1/src/dirigera.egg-info/requires.txt +7 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_scenes.py +68 -0
- dirigera-1.3.0/src/dirigera.egg-info/requires.txt +0 -7
- {dirigera-1.3.0 → dirigera-1.3.1}/LICENSE +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/README.md +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/setup.cfg +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/setup.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/__init__.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/__init__.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/__init__.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/air_purifier.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/base_ikea_model.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/blinds.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/controller.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/device.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/electrical_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/environment_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/light.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/light_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/motion_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/occupancy_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/open_close_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/outlet.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/devices/water_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/hub/__init__.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/hub/abstract_smart_home_hub.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/hub/auth.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/hub/hub.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera/hub/utils.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera.egg-info/SOURCES.txt +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera.egg-info/dependency_links.txt +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera.egg-info/entry_points.txt +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/src/dirigera.egg-info/top_level.txt +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_air_purifier.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_blinds.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_controller.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_electrical_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_environment_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_hub.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_hub_get_by_name.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_light.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_light_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_motion_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_occupancy_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_open_close_sensor.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_outlet.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_utils.py +0 -0
- {dirigera-1.3.0 → dirigera-1.3.1}/tests/test_water_sensor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dirigera
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: An unofficial Python client for controlling the IKEA Dirigera Smart Home Hub
|
|
5
5
|
Author-email: Leggin <legginsun@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -39,8 +39,8 @@ Requires-Python: >=3.7
|
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
40
|
License-File: LICENSE
|
|
41
41
|
Requires-Dist: requests>=2.22.0
|
|
42
|
-
Requires-Dist: websocket-client>=1.
|
|
43
|
-
Requires-Dist: pydantic>=
|
|
42
|
+
Requires-Dist: websocket-client>=1.4.0
|
|
43
|
+
Requires-Dist: pydantic>=2.0
|
|
44
44
|
Provides-Extra: dev
|
|
45
45
|
Requires-Dist: black; extra == "dev"
|
|
46
46
|
Requires-Dist: pytest; extra == "dev"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dirigera"
|
|
7
|
-
version = "1.3.
|
|
7
|
+
version = "1.3.1"
|
|
8
8
|
description = "An unofficial Python client for controlling the IKEA Dirigera Smart Home Hub"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
authors = [{ name = "Leggin", email = "legginsun@gmail.com" }]
|
|
@@ -21,8 +21,8 @@ keywords = [
|
|
|
21
21
|
]
|
|
22
22
|
dependencies = [
|
|
23
23
|
"requests >= 2.22.0",
|
|
24
|
-
"websocket-client >= 1.
|
|
25
|
-
"pydantic >=
|
|
24
|
+
"websocket-client >= 1.4.0",
|
|
25
|
+
"pydantic >= 2.0",
|
|
26
26
|
]
|
|
27
27
|
requires-python = ">=3.7"
|
|
28
28
|
classifiers = [
|
|
@@ -89,6 +89,7 @@ class TriggerDetails(BaseIkeaModel):
|
|
|
89
89
|
click_pattern: Optional[ClickPattern] = None
|
|
90
90
|
device_id: Optional[str] = None
|
|
91
91
|
offset: Optional[int] = None
|
|
92
|
+
duration: Optional[int] = None # seconds, used by end triggers of type "duration"
|
|
92
93
|
type: Optional[str] = None
|
|
93
94
|
|
|
94
95
|
# Deprecated camelCase accessors, kept so existing code reading the old attribute names keeps working.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dirigera
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: An unofficial Python client for controlling the IKEA Dirigera Smart Home Hub
|
|
5
5
|
Author-email: Leggin <legginsun@gmail.com>
|
|
6
6
|
License: MIT License
|
|
@@ -39,8 +39,8 @@ Requires-Python: >=3.7
|
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
40
|
License-File: LICENSE
|
|
41
41
|
Requires-Dist: requests>=2.22.0
|
|
42
|
-
Requires-Dist: websocket-client>=1.
|
|
43
|
-
Requires-Dist: pydantic>=
|
|
42
|
+
Requires-Dist: websocket-client>=1.4.0
|
|
43
|
+
Requires-Dist: pydantic>=2.0
|
|
44
44
|
Provides-Extra: dev
|
|
45
45
|
Requires-Dist: black; extra == "dev"
|
|
46
46
|
Requires-Dist: pytest; extra == "dev"
|
|
@@ -8,6 +8,7 @@ from src.dirigera.devices.scene import (
|
|
|
8
8
|
dict_to_scene,
|
|
9
9
|
ControllerType,
|
|
10
10
|
ClickPattern,
|
|
11
|
+
EndTriggerEvent,
|
|
11
12
|
Icon,
|
|
12
13
|
Info,
|
|
13
14
|
SceneType,
|
|
@@ -286,3 +287,70 @@ def test_create_scene_posts_camel_case_trigger_details(
|
|
|
286
287
|
},
|
|
287
288
|
}
|
|
288
289
|
]
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def test_trigger_with_duration_end_trigger() -> None:
|
|
293
|
+
trigger = Trigger(
|
|
294
|
+
**{
|
|
295
|
+
"type": "time",
|
|
296
|
+
"disabled": False,
|
|
297
|
+
"trigger": {"days": ["Mon"], "time": "00:00"},
|
|
298
|
+
"endTrigger": {"type": "duration", "trigger": {"duration": 21600}},
|
|
299
|
+
"endTriggerEvent": {"type": "duration", "trigger": {"duration": 21600}},
|
|
300
|
+
}
|
|
301
|
+
)
|
|
302
|
+
assert trigger.end_trigger is not None
|
|
303
|
+
assert trigger.end_trigger.type == "duration"
|
|
304
|
+
assert trigger.end_trigger.trigger.duration == 21600
|
|
305
|
+
assert trigger.end_trigger_event is not None
|
|
306
|
+
assert trigger.end_trigger_event.trigger.duration == 21600
|
|
307
|
+
|
|
308
|
+
|
|
309
|
+
def test_create_scene_posts_duration_end_trigger(
|
|
310
|
+
monkeypatch: pytest.MonkeyPatch,
|
|
311
|
+
) -> None:
|
|
312
|
+
hub = Hub(token="token", ip_address="127.0.0.1")
|
|
313
|
+
post_actions: List[Dict[str, Any]] = []
|
|
314
|
+
|
|
315
|
+
def fake_post(route: str, data: Optional[Dict[str, Any]] = None) -> Any:
|
|
316
|
+
post_actions.append({"route": route, "data": data})
|
|
317
|
+
return {"id": TEST_ID}
|
|
318
|
+
|
|
319
|
+
def fake_get(_route: str) -> Any:
|
|
320
|
+
return {
|
|
321
|
+
"id": TEST_ID,
|
|
322
|
+
"info": {"name": TEST_NAME, "icon": TEST_ICON},
|
|
323
|
+
"type": "customScene",
|
|
324
|
+
"triggers": [],
|
|
325
|
+
"actions": [],
|
|
326
|
+
"commands": [],
|
|
327
|
+
"createdAt": "2023-08-27T10:28:48.096Z",
|
|
328
|
+
"undoAllowedDuration": 30,
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
monkeypatch.setattr(hub, "post", fake_post)
|
|
332
|
+
monkeypatch.setattr(hub, "get", fake_get)
|
|
333
|
+
|
|
334
|
+
hub.create_scene(
|
|
335
|
+
info=Info(name=TEST_NAME, icon=Icon.SCENES_CLEAN_SPARKLES),
|
|
336
|
+
scene_type=SceneType.CUSTOM_SCENE,
|
|
337
|
+
triggers=[
|
|
338
|
+
Trigger(
|
|
339
|
+
type="time",
|
|
340
|
+
disabled=False,
|
|
341
|
+
trigger=TriggerDetails(days=["Mon"], time="00:00"),
|
|
342
|
+
endTriggerEvent=EndTriggerEvent(
|
|
343
|
+
type="duration", trigger=TriggerDetails(duration=21600)
|
|
344
|
+
),
|
|
345
|
+
)
|
|
346
|
+
],
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
assert post_actions[0]["data"]["triggers"] == [
|
|
350
|
+
{
|
|
351
|
+
"type": "time",
|
|
352
|
+
"disabled": False,
|
|
353
|
+
"trigger": {"days": ["Mon"], "time": "00:00"},
|
|
354
|
+
"endTriggerEvent": {"type": "duration", "trigger": {"duration": 21600}},
|
|
355
|
+
}
|
|
356
|
+
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|