TISControlProtocol 0.3.3__tar.gz → 0.4.0__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.
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/PKG-INFO +1 -1
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/pyproject.toml +1 -1
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/ProtocolHandler.py +55 -3
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/.gitignore +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/.vscode/c_cpp_properties.json +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/.vscode/launch.json +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/.vscode/settings.json +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/.vscode/tasks.json +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/LICENSE +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/README.md +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/dev/pump_version.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/BytesHelper.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/__init__.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/AckCoordinator.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketDispatcher.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketExtractor.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/AutoBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/BinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateControlFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ControlResponseHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/DiscoveryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/HealthFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/LunaTempFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/RealTimeFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/SearchResponseHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/SecurityFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/UpdateResponseHandler.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketHandlers/__init__.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketProtocol.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketReceiver.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/PacketSender.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/UpdateCoordinator.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/udp/__init__.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/ST7789/__init__.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/__init__.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/api.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/crc.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/dev_api.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/logo.png +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/mock_api.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/shared.py +0 -0
- {tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/tests/test.py +0 -0
|
@@ -54,6 +54,7 @@ class TISProtocolHandler:
|
|
|
54
54
|
OPERATION_GET_HEALTH = [0x20, 0x24]
|
|
55
55
|
OPERATION_DISCOVERY = [0x00, 0x0E]
|
|
56
56
|
OPERATION_CONTROL_SECURITY = [0x01, 0x04]
|
|
57
|
+
OPERATION_CONTROL_AC = [0xE0, 0xEE]
|
|
57
58
|
|
|
58
59
|
def __init__(self) -> None:
|
|
59
60
|
"""Initialize a ProtocolHandler instance."""
|
|
@@ -118,7 +119,7 @@ class TISProtocolHandler:
|
|
|
118
119
|
destination_ip=entity.gateway,
|
|
119
120
|
additional_bytes=[0x00],
|
|
120
121
|
)
|
|
121
|
-
|
|
122
|
+
|
|
122
123
|
def generate_health_sensor_update_packet(self, entity) -> TISPacket:
|
|
123
124
|
"""
|
|
124
125
|
Generate a packet to update the health sensor.
|
|
@@ -195,7 +196,7 @@ class TISProtocolHandler:
|
|
|
195
196
|
additional_bytes=[entity.b_channel, color[2], 0x00, 0x00],
|
|
196
197
|
),
|
|
197
198
|
)
|
|
198
|
-
|
|
199
|
+
|
|
199
200
|
def generate_rgbw_light_control_packet(
|
|
200
201
|
self, entity, color: Tuple[int, int, int, int]
|
|
201
202
|
) -> Tuple[TISPacket]:
|
|
@@ -291,7 +292,7 @@ class TISProtocolHandler:
|
|
|
291
292
|
additional_bytes=[entity.down_channel_number, 0x00, 0x00, 0x00],
|
|
292
293
|
),
|
|
293
294
|
)
|
|
294
|
-
|
|
295
|
+
|
|
295
296
|
def generate_control_security_packet(self, entity, mode) -> TISPacket:
|
|
296
297
|
"""
|
|
297
298
|
Generate a packet to set the security mode.
|
|
@@ -308,3 +309,54 @@ class TISProtocolHandler:
|
|
|
308
309
|
destination_ip=entity.gateway,
|
|
309
310
|
additional_bytes=[entity.channel_number, mode],
|
|
310
311
|
)
|
|
312
|
+
|
|
313
|
+
def generate_ac_control_packet(
|
|
314
|
+
self,
|
|
315
|
+
entity,
|
|
316
|
+
target_state: bool | None = None,
|
|
317
|
+
target_temperature: float | None = None,
|
|
318
|
+
target_mode: HVACMode | None = None, # noqa: F821 # type: ignore
|
|
319
|
+
target_fan_mode: str | None = None,
|
|
320
|
+
temperature_ranges: dict = {},
|
|
321
|
+
fan_modes: dict = {},
|
|
322
|
+
) -> TISPacket:
|
|
323
|
+
|
|
324
|
+
# Determine the target values, falling back to class attributes if not provided
|
|
325
|
+
target_state = target_state if target_state is not None else entity._attr_state
|
|
326
|
+
target_temperature = (
|
|
327
|
+
target_temperature
|
|
328
|
+
if target_temperature is not None
|
|
329
|
+
else entity._attr_target_temperature
|
|
330
|
+
)
|
|
331
|
+
target_mode = target_mode if target_mode is not None else entity.hvac_mode
|
|
332
|
+
target_fan_mode = (
|
|
333
|
+
target_fan_mode if target_fan_mode is not None else entity._attr_fan_mode
|
|
334
|
+
)
|
|
335
|
+
# Convert target temperature to byte
|
|
336
|
+
target_temperature_byte = (
|
|
337
|
+
int(target_temperature) if target_temperature else 0x00
|
|
338
|
+
)
|
|
339
|
+
# Construct the additional bytes for the packet
|
|
340
|
+
additional_bytes = [
|
|
341
|
+
entity.ac_number,
|
|
342
|
+
int(target_state),
|
|
343
|
+
target_temperature_byte,
|
|
344
|
+
int(
|
|
345
|
+
(temperature_ranges[target_mode]["packet_mode_index"] << 4)
|
|
346
|
+
| fan_modes[target_fan_mode]
|
|
347
|
+
),
|
|
348
|
+
0x01,
|
|
349
|
+
target_temperature_byte,
|
|
350
|
+
target_temperature_byte,
|
|
351
|
+
target_temperature_byte,
|
|
352
|
+
0x00,
|
|
353
|
+
]
|
|
354
|
+
|
|
355
|
+
# Generate and return the packet
|
|
356
|
+
return TISPacket(
|
|
357
|
+
device_id=entity.device_id,
|
|
358
|
+
operation_code=self.OPERATION_CONTROL_AC,
|
|
359
|
+
source_ip=entity.api.host,
|
|
360
|
+
destination_ip=entity.gateway,
|
|
361
|
+
additional_bytes=additional_bytes,
|
|
362
|
+
)
|
|
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
|
{tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/Protocols/__init__.py
RENAMED
|
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
|
{tiscontrolprotocol-0.3.3 → tiscontrolprotocol-0.4.0}/src/TISControlProtocol/ST7789/__init__.py
RENAMED
|
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
|