pyControl4 1.2.1__py3-none-any.whl → 1.4.0__py3-none-any.whl
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.
- pyControl4/alarm.py +1 -2
- pyControl4/blind.py +1 -2
- pyControl4/climate.py +133 -0
- pyControl4/director.py +1 -1
- pyControl4/fan.py +81 -0
- pyControl4/light.py +1 -2
- pyControl4/relay.py +1 -2
- pyControl4/room.py +1 -2
- {pyControl4-1.2.1.dist-info → pycontrol4-1.4.0.dist-info}/METADATA +12 -2
- pycontrol4-1.4.0.dist-info/RECORD +17 -0
- {pyControl4-1.2.1.dist-info → pycontrol4-1.4.0.dist-info}/WHEEL +1 -1
- pyControl4-1.2.1.dist-info/RECORD +0 -15
- {pyControl4-1.2.1.dist-info → pycontrol4-1.4.0.dist-info/licenses}/LICENSE +0 -0
- {pyControl4-1.2.1.dist-info → pycontrol4-1.4.0.dist-info}/top_level.txt +0 -0
pyControl4/alarm.py
CHANGED
pyControl4/blind.py
CHANGED
pyControl4/climate.py
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"""Controls Control4 Climate Control devices."""
|
|
2
|
+
|
|
3
|
+
from pyControl4 import C4Entity
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class C4Climate(C4Entity):
|
|
7
|
+
# ------------------------
|
|
8
|
+
# HVAC and Fan States
|
|
9
|
+
# ------------------------
|
|
10
|
+
|
|
11
|
+
async def getHVACState(self):
|
|
12
|
+
"""Returns the current HVAC state (e.g., on/off or active mode)."""
|
|
13
|
+
return await self.director.getItemVariableValue(self.item_id, "HVAC_STATE")
|
|
14
|
+
|
|
15
|
+
async def getFANState(self):
|
|
16
|
+
"""Returns the current power state of the fan (True=on, False=off)."""
|
|
17
|
+
return await self.director.getItemVariableValue(self.item_id, "FAN_STATE")
|
|
18
|
+
|
|
19
|
+
# ------------------------
|
|
20
|
+
# Mode Getters
|
|
21
|
+
# ------------------------
|
|
22
|
+
|
|
23
|
+
async def getHVACMode(self):
|
|
24
|
+
"""Returns the currently active HVAC mode."""
|
|
25
|
+
return await self.director.getItemVariableValue(self.item_id, "HVAC_MODE")
|
|
26
|
+
|
|
27
|
+
async def getHVACModes(self):
|
|
28
|
+
"""Returns a list of supported HVAC modes."""
|
|
29
|
+
return await self.director.getItemVariableValue(self.item_id, "HVAC_MODES_LIST")
|
|
30
|
+
|
|
31
|
+
async def getFANMode(self):
|
|
32
|
+
"""Returns the currently active fan mode."""
|
|
33
|
+
return await self.director.getItemVariableValue(self.item_id, "FAN_MODE")
|
|
34
|
+
|
|
35
|
+
async def getFANModes(self):
|
|
36
|
+
"""Returns a list of supported fan modes."""
|
|
37
|
+
return await self.director.getItemVariableValue(self.item_id, "FAN_MODES_LIST")
|
|
38
|
+
|
|
39
|
+
# ------------------------
|
|
40
|
+
# Setpoint Getters
|
|
41
|
+
# ------------------------
|
|
42
|
+
|
|
43
|
+
async def getCoolSetpointF(self):
|
|
44
|
+
"""Returns the cooling setpoint temperature in Fahrenheit."""
|
|
45
|
+
return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_F")
|
|
46
|
+
|
|
47
|
+
async def getCoolSetpointC(self):
|
|
48
|
+
"""Returns the cooling setpoint temperature in Celsius."""
|
|
49
|
+
return await self.director.getItemVariableValue(self.item_id, "COOL_SETPOINT_C")
|
|
50
|
+
|
|
51
|
+
async def getHeatSetpointF(self):
|
|
52
|
+
"""Returns the heating setpoint temperature in Fahrenheit."""
|
|
53
|
+
return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_F")
|
|
54
|
+
|
|
55
|
+
async def getHeatSetpointC(self):
|
|
56
|
+
"""Returns the heating setpoint temperature in Celsius."""
|
|
57
|
+
return await self.director.getItemVariableValue(self.item_id, "HEAT_SETPOINT_C")
|
|
58
|
+
|
|
59
|
+
# ------------------------
|
|
60
|
+
# Sensor Readings
|
|
61
|
+
# ------------------------
|
|
62
|
+
|
|
63
|
+
async def getHumidity(self):
|
|
64
|
+
"""Returns the current humidity percentage."""
|
|
65
|
+
return await self.director.getItemVariableValue(self.item_id, "HUMIDITY")
|
|
66
|
+
|
|
67
|
+
async def getCurrentTemperatureF(self):
|
|
68
|
+
"""Returns the current ambient temperature in Fahrenheit."""
|
|
69
|
+
return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_F")
|
|
70
|
+
|
|
71
|
+
async def getCurrentTemperatureC(self):
|
|
72
|
+
"""Returns the current ambient temperature in Celsius."""
|
|
73
|
+
return await self.director.getItemVariableValue(self.item_id, "TEMPERATURE_C")
|
|
74
|
+
|
|
75
|
+
# ------------------------
|
|
76
|
+
# Setters / Commands
|
|
77
|
+
# ------------------------
|
|
78
|
+
|
|
79
|
+
async def setCoolSetpointF(self, temp):
|
|
80
|
+
"""Sets the cooling setpoint temperature in Fahrenheit."""
|
|
81
|
+
await self.director.sendPostRequest(
|
|
82
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
83
|
+
"SET_SETPOINT_COOL",
|
|
84
|
+
{"FAHRENHEIT": temp},
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
async def setCoolSetpointC(self, temp):
|
|
88
|
+
"""Sets the cooling setpoint temperature in Celsius."""
|
|
89
|
+
await self.director.sendPostRequest(
|
|
90
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
91
|
+
"SET_SETPOINT_COOL",
|
|
92
|
+
{"CELSIUS": temp},
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
async def setHeatSetpointF(self, temp):
|
|
96
|
+
"""Sets the heating setpoint temperature in Fahrenheit."""
|
|
97
|
+
await self.director.sendPostRequest(
|
|
98
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
99
|
+
"SET_SETPOINT_HEAT",
|
|
100
|
+
{"FAHRENHEIT": temp},
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
async def setHeatSetpointC(self, temp):
|
|
104
|
+
"""Sets the heating setpoint temperature in Celsius."""
|
|
105
|
+
await self.director.sendPostRequest(
|
|
106
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
107
|
+
"SET_SETPOINT_HEAT",
|
|
108
|
+
{"CELSIUS": temp},
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
async def setHvacMode(self, mode):
|
|
112
|
+
"""Sets the HVAC operating mode (e.g., heat, cool, auto)."""
|
|
113
|
+
await self.director.sendPostRequest(
|
|
114
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
115
|
+
"SET_MODE_HVAC",
|
|
116
|
+
{"MODE": mode},
|
|
117
|
+
)
|
|
118
|
+
|
|
119
|
+
async def setFanMode(self, mode):
|
|
120
|
+
"""Sets the fan operating mode (e.g., auto, on, circulate)."""
|
|
121
|
+
await self.director.sendPostRequest(
|
|
122
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
123
|
+
"SET_MODE_FAN",
|
|
124
|
+
{"MODE": mode},
|
|
125
|
+
)
|
|
126
|
+
|
|
127
|
+
async def setPreset(self, preset):
|
|
128
|
+
"""Applies a predefined climate preset by name."""
|
|
129
|
+
await self.director.sendPostRequest(
|
|
130
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
131
|
+
"SET_PRESET",
|
|
132
|
+
{"NAME": preset},
|
|
133
|
+
)
|
pyControl4/director.py
CHANGED
pyControl4/fan.py
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"""Controls Control4 Fan devices."""
|
|
2
|
+
|
|
3
|
+
from pyControl4 import C4Entity
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class C4Fan(C4Entity):
|
|
7
|
+
# ------------------------
|
|
8
|
+
# Fan State Getters
|
|
9
|
+
# ------------------------
|
|
10
|
+
|
|
11
|
+
async def getState(self):
|
|
12
|
+
"""
|
|
13
|
+
Returns the current power state of the fan.
|
|
14
|
+
|
|
15
|
+
Returns:
|
|
16
|
+
bool: True if the fan is on, False otherwise.
|
|
17
|
+
"""
|
|
18
|
+
value = await self.director.getItemVariableValue(self.item_id, "IS_ON")
|
|
19
|
+
return bool(value)
|
|
20
|
+
|
|
21
|
+
async def getSpeed(self):
|
|
22
|
+
"""
|
|
23
|
+
Returns the current speed of the fan controller.
|
|
24
|
+
|
|
25
|
+
Valid speed values:
|
|
26
|
+
0 - Off
|
|
27
|
+
1 - Low
|
|
28
|
+
2 - Medium
|
|
29
|
+
3 - Medium High
|
|
30
|
+
4 - High
|
|
31
|
+
|
|
32
|
+
Note:
|
|
33
|
+
Only valid for fan controllers. On non-dimmer switches,
|
|
34
|
+
use `getState()` instead.
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
int: Current fan speed (0–4).
|
|
38
|
+
"""
|
|
39
|
+
value = await self.director.getItemVariableValue(self.item_id, "CURRENT_SPEED")
|
|
40
|
+
return int(value)
|
|
41
|
+
|
|
42
|
+
# ------------------------
|
|
43
|
+
# Fan Control Setters
|
|
44
|
+
# ------------------------
|
|
45
|
+
|
|
46
|
+
async def setSpeed(self, speed: int):
|
|
47
|
+
"""
|
|
48
|
+
Sets the fan speed or turns it off.
|
|
49
|
+
|
|
50
|
+
Parameters:
|
|
51
|
+
speed (int): Fan speed level:
|
|
52
|
+
0 - Off
|
|
53
|
+
1 - Low
|
|
54
|
+
2 - Medium
|
|
55
|
+
3 - Medium High
|
|
56
|
+
4 - High
|
|
57
|
+
"""
|
|
58
|
+
await self.director.sendPostRequest(
|
|
59
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
60
|
+
"SET_SPEED",
|
|
61
|
+
{"SPEED": speed},
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
async def setPreset(self, preset: int):
|
|
65
|
+
"""
|
|
66
|
+
Sets the fan's preset speed — the speed used when the fan is
|
|
67
|
+
turned on without specifying speed.
|
|
68
|
+
|
|
69
|
+
Parameters:
|
|
70
|
+
preset (int): Preset fan speed level:
|
|
71
|
+
0 - Off
|
|
72
|
+
1 - Low
|
|
73
|
+
2 - Medium
|
|
74
|
+
3 - Medium High
|
|
75
|
+
4 - High
|
|
76
|
+
"""
|
|
77
|
+
await self.director.sendPostRequest(
|
|
78
|
+
f"/api/v1/items/{self.item_id}/commands",
|
|
79
|
+
"DESIGNATE_PRESET",
|
|
80
|
+
{"PRESET": preset},
|
|
81
|
+
)
|
pyControl4/light.py
CHANGED
pyControl4/relay.py
CHANGED
pyControl4/room.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pyControl4
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0
|
|
4
4
|
Summary: Python 3 asyncio package for interacting with Control4 systems
|
|
5
5
|
Home-page: https://github.com/lawtancool/pyControl4
|
|
6
6
|
Author: lawtancool
|
|
@@ -15,6 +15,16 @@ Requires-Dist: aiohttp
|
|
|
15
15
|
Requires-Dist: xmltodict
|
|
16
16
|
Requires-Dist: python-socketio-v4
|
|
17
17
|
Requires-Dist: websocket-client
|
|
18
|
+
Dynamic: author
|
|
19
|
+
Dynamic: author-email
|
|
20
|
+
Dynamic: classifier
|
|
21
|
+
Dynamic: description
|
|
22
|
+
Dynamic: description-content-type
|
|
23
|
+
Dynamic: home-page
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
Dynamic: requires-dist
|
|
26
|
+
Dynamic: requires-python
|
|
27
|
+
Dynamic: summary
|
|
18
28
|
|
|
19
29
|
# pyControl4
|
|
20
30
|
[](https://badge.fury.io/py/pyControl4)[](https://pepy.tech/project/pycontrol4)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
pyControl4/__init__.py,sha256=JR6zFcZJ-M1o8g28gdU71uZHYzh-b21x7rg3EWrf3hg,394
|
|
2
|
+
pyControl4/account.py,sha256=eyWkGaDla4_gLvv8GHBxmJ2iBMxpdY7ax53JryWOtcE,9760
|
|
3
|
+
pyControl4/alarm.py,sha256=KcZreUOocncgoIoRVHl9ZL1zesrXuVYPfXVvDuUpXcs,7153
|
|
4
|
+
pyControl4/blind.py,sha256=7Aat1FyT-OJyv_xES-ol2U-70nKpQbymGUfTTsB3VDk,4436
|
|
5
|
+
pyControl4/climate.py,sha256=c2UEJWSti6DPNcwf5UL2JYpzf-X-fallhxhzGFEIxz8,4949
|
|
6
|
+
pyControl4/director.py,sha256=QY6Re-fGgV-V340rTjpkSCfqvVRD_kbnDEHScoGJ0gk,10718
|
|
7
|
+
pyControl4/error_handling.py,sha256=3VpZ4JsF5kgrSNASHYVEQVIJq_vs8kvMk0-bDsd_FXU,3866
|
|
8
|
+
pyControl4/fan.py,sha256=MldA1E5VDkLJrS2Zp-5tUBEgPsUGYH7D6J-i2OdFJ5I,2140
|
|
9
|
+
pyControl4/light.py,sha256=qc8AGFiM9wnS-gi1tecWGGBRo-9dPZzYBHvE0QenW8w,1587
|
|
10
|
+
pyControl4/relay.py,sha256=GWYxdaB9sG3ixD87IY2yV3UKulIB7mkq1xyjxtUDW1Q,2225
|
|
11
|
+
pyControl4/room.py,sha256=nGhVxTw1QjX3UFmFZEO8TYBPCUae-NqObuVTPShEkqs,5195
|
|
12
|
+
pyControl4/websocket.py,sha256=9UsxO8tFUENuya1tzwTYk2haWnnDutUgQ5jTLTlr5dU,8823
|
|
13
|
+
pycontrol4-1.4.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
14
|
+
pycontrol4-1.4.0.dist-info/METADATA,sha256=-6Xbfy3fWMHePbDtBzkWFG6bCg03fWmJDu7yESsjD5U,3285
|
|
15
|
+
pycontrol4-1.4.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
16
|
+
pycontrol4-1.4.0.dist-info/top_level.txt,sha256=8hJWE4Vz6ySUM1pzgZQCyngE7zVDW8qp7qe_4JXKRpY,11
|
|
17
|
+
pycontrol4-1.4.0.dist-info/RECORD,,
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
pyControl4/__init__.py,sha256=JR6zFcZJ-M1o8g28gdU71uZHYzh-b21x7rg3EWrf3hg,394
|
|
2
|
-
pyControl4/account.py,sha256=eyWkGaDla4_gLvv8GHBxmJ2iBMxpdY7ax53JryWOtcE,9760
|
|
3
|
-
pyControl4/alarm.py,sha256=NHsrdzILMRf9-PdRIQr-7kZnsupcmH1o1khM3-iY08M,7154
|
|
4
|
-
pyControl4/blind.py,sha256=lgiWMdw3xxPO2VZd-ozX6QMAnhdj5-Z07NGTF-Tj3Ao,4437
|
|
5
|
-
pyControl4/director.py,sha256=dGsoPV88xO8FFtv59oNxYtNc1-3d1XhCdBqnaIBQ700,10721
|
|
6
|
-
pyControl4/error_handling.py,sha256=3VpZ4JsF5kgrSNASHYVEQVIJq_vs8kvMk0-bDsd_FXU,3866
|
|
7
|
-
pyControl4/light.py,sha256=gShT4QWhudVEYRWB0AGQYh-53FMwhuyjD6zUVXM142I,1588
|
|
8
|
-
pyControl4/relay.py,sha256=O8dGVF2b2Gfi1623en9jDMPbUPESwavTt-AYdQhOIQ4,2226
|
|
9
|
-
pyControl4/room.py,sha256=OyKoCyMst00RWSgNy7yBX9rS-0d2MUNd8_hvpJ-rSvg,5196
|
|
10
|
-
pyControl4/websocket.py,sha256=9UsxO8tFUENuya1tzwTYk2haWnnDutUgQ5jTLTlr5dU,8823
|
|
11
|
-
pyControl4-1.2.1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
-
pyControl4-1.2.1.dist-info/METADATA,sha256=Zk_D_xb3o8fMeh46saxV0PwjvZA4uL9Zd09Pn6QdIuQ,3066
|
|
13
|
-
pyControl4-1.2.1.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
|
14
|
-
pyControl4-1.2.1.dist-info/top_level.txt,sha256=8hJWE4Vz6ySUM1pzgZQCyngE7zVDW8qp7qe_4JXKRpY,11
|
|
15
|
-
pyControl4-1.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|