clevertouch 0.4.2b2__tar.gz → 0.4.2b4__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.
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/PKG-INFO +1 -1
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/pyproject.toml +1 -1
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/devices/const.py +8 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/devices/device.py +2 -2
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/devices/factory.py +7 -6
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/devices/onoff.py +2 -2
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/devices/radiator.py +1 -1
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/LICENSE +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/README.md +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/__init__.py +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/api.py +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/devices/__init__.py +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/info.py +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/objects.py +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/src/clevertouch/util.py +0 -0
- {clevertouch-0.4.2b2 → clevertouch-0.4.2b4}/tests/authenticate_test.py +0 -0
|
@@ -15,7 +15,7 @@ class Device:
|
|
|
15
15
|
home: HomeInfo,
|
|
16
16
|
data: dict[str, Any],
|
|
17
17
|
device_type: str,
|
|
18
|
-
device_type_id:
|
|
18
|
+
device_type_id: str,
|
|
19
19
|
*,
|
|
20
20
|
do_update: bool = True
|
|
21
21
|
) -> None:
|
|
@@ -23,7 +23,7 @@ class Device:
|
|
|
23
23
|
self._session: ApiSession = session
|
|
24
24
|
self.home: HomeInfo = home
|
|
25
25
|
self.device_id: str = Device.get_id(data)
|
|
26
|
-
self.device_type_id:
|
|
26
|
+
self.device_type_id: str = device_type_id
|
|
27
27
|
if do_update:
|
|
28
28
|
self.update(data)
|
|
29
29
|
|
|
@@ -5,19 +5,20 @@ from typing import Any
|
|
|
5
5
|
from ..api import ApiSession
|
|
6
6
|
from ..info import HomeInfo
|
|
7
7
|
from .device import Device
|
|
8
|
-
from .const import DeviceType, DeviceTypeId
|
|
8
|
+
from .const import DeviceType, DeviceTypeId, DeviceTypeChar
|
|
9
9
|
from .onoff import Light, Outlet
|
|
10
10
|
from .radiator import Radiator
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def create_device(session: ApiSession, home: HomeInfo, data: dict[str, Any]) -> Device:
|
|
14
14
|
"""Create a device of of specific types based on the provided data."""
|
|
15
|
-
device_type_id = int(data["nv_mode"] or DeviceTypeId.UNDEFINED)
|
|
16
|
-
|
|
15
|
+
# device_type_id = int(data["nv_mode"] or DeviceTypeId.UNDEFINED)
|
|
16
|
+
device_type_char = str(data.get("id_device", "U")[0])
|
|
17
|
+
if device_type_char == DeviceTypeChar.RADIATOR:
|
|
17
18
|
return Radiator(session, home, data)
|
|
18
|
-
elif
|
|
19
|
+
elif device_type_char == DeviceTypeChar.LIGHT:
|
|
19
20
|
return Light(session, home, data)
|
|
20
|
-
elif
|
|
21
|
+
elif device_type_char == DeviceTypeChar.OUTLET:
|
|
21
22
|
return Outlet(session, home, data)
|
|
22
23
|
else:
|
|
23
|
-
return Device(session, home, data, DeviceType.UNKNOWN,
|
|
24
|
+
return Device(session, home, data, DeviceType.UNKNOWN, device_type_char)
|
|
@@ -37,8 +37,8 @@ class OnOffDevice(Device):
|
|
|
37
37
|
query_params = {}
|
|
38
38
|
query_params["id_device"] = self.id_local
|
|
39
39
|
query_params["on_off"] = "1" if turn_on else "0"
|
|
40
|
-
query_params["nv_mode"] = self.device_type_id
|
|
41
|
-
query_params["gv_mode"] = self.device_type_id
|
|
40
|
+
#query_params["nv_mode"] = self.device_type_id
|
|
41
|
+
#query_params["gv_mode"] = self.device_type_id
|
|
42
42
|
|
|
43
43
|
await self._session.write_query(self.home.home_id, query_params)
|
|
44
44
|
|
|
@@ -45,7 +45,7 @@ class Radiator(Device):
|
|
|
45
45
|
_DEVICE_TO_MODE_TYPE: dict[str, _ModeInfo] = {
|
|
46
46
|
"0": _ModeInfo(HeatMode.COMFORT, TempType.COMFORT),
|
|
47
47
|
"1": _ModeInfo(HeatMode.OFF, TempType.NONE),
|
|
48
|
-
"2": _ModeInfo(HeatMode.
|
|
48
|
+
"2": _ModeInfo(HeatMode.FROST, TempType.FROST),
|
|
49
49
|
"3": _ModeInfo(HeatMode.ECO, TempType.ECO),
|
|
50
50
|
"4": _ModeInfo(HeatMode.BOOST, TempType.BOOST),
|
|
51
51
|
# "5": ModeInfo("fan", None),
|
|
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
|