TISControlProtocol 0.2.7__tar.gz → 0.2.9__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.2.7 → tiscontrolprotocol-0.2.9}/PKG-INFO +1 -1
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/pyproject.toml +1 -1
- tiscontrolprotocol-0.2.9/src/TISControlProtocol/Protocols/udp/PacketHandlers/LuxFeedbackHandler.py +22 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketProtocol.py +3 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/ProtocolHandler.py +19 -3
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/.gitignore +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/.vscode/c_cpp_properties.json +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/.vscode/launch.json +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/.vscode/settings.json +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/.vscode/tasks.json +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/LICENSE +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/README.md +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/dev/pump_version.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/BytesHelper.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/__init__.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/AckCoordinator.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketDispatcher.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketExtractor.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/AutoBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/BinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateControlFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ControlResponseHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/DiscoveryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/LunaTempFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/RealTimeFeedbackHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/SearchResponseHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/UpdateResponseHandler.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketHandlers/__init__.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketReceiver.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/PacketSender.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/UpdateCoordinator.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/Protocols/udp/__init__.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/ST7789/__init__.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/__init__.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/api.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/crc.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/dev_api.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/logo.png +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/mock_api.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/src/TISControlProtocol/shared.py +0 -0
- {tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/tests/test.py +0 -0
tiscontrolprotocol-0.2.9/src/TISControlProtocol/Protocols/udp/PacketHandlers/LuxFeedbackHandler.py
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
from homeassistant.core import HomeAssistant
|
|
2
|
+
import logging
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
def handle_lux_feedback(hass: HomeAssistant, info: dict):
|
|
6
|
+
"""
|
|
7
|
+
Handle the feedback from a Lux sensor.
|
|
8
|
+
"""
|
|
9
|
+
device_id = info["device_id"]
|
|
10
|
+
temperature = int(info["additional_bytes"][6])
|
|
11
|
+
|
|
12
|
+
event_data = {
|
|
13
|
+
"device_id": device_id,
|
|
14
|
+
"temperature": temperature,
|
|
15
|
+
}
|
|
16
|
+
try:
|
|
17
|
+
hass.bus.async_fire(str(info["device_id"]), event_data)
|
|
18
|
+
logging.error(
|
|
19
|
+
f"control response event fired for {info['device_id']}, additional bytes: {info['additional_bytes']}"
|
|
20
|
+
)
|
|
21
|
+
except Exception as e:
|
|
22
|
+
logging.error(f"error in firing even for feedbackt: {e}")
|
|
@@ -19,6 +19,8 @@ from .PacketHandlers.DiscoveryFeedbackHandler import handle_discovery_feedback
|
|
|
19
19
|
from .PacketHandlers.UpdateResponseHandler import handle_update_response
|
|
20
20
|
from .PacketHandlers.RealTimeFeedbackHandler import handle_real_time_feedback
|
|
21
21
|
from .PacketHandlers.LunaTempFeedbackHandler import handle_luna_temp_feedback
|
|
22
|
+
from .PacketHandlers.LuxFeedbackHandler import handle_lux_feedback
|
|
23
|
+
|
|
22
24
|
|
|
23
25
|
import socket as Socket
|
|
24
26
|
|
|
@@ -32,6 +34,7 @@ OPERATIONS_DICT = {
|
|
|
32
34
|
(0x00, 0x34): handle_update_response,
|
|
33
35
|
(0x00, 0x31): handle_real_time_feedback,
|
|
34
36
|
(0xE3, 0xE8): handle_luna_temp_feedback,
|
|
37
|
+
(0x20, 0x25): handle_lux_feedback,
|
|
35
38
|
}
|
|
36
39
|
# 1C 01 30 1B BA DC 22 FF FF 08 02 02 02 02 02 02 02 02 00 01 01 01 01 01 01 01 57 62
|
|
37
40
|
|
|
@@ -50,7 +50,8 @@ class TISPacket:
|
|
|
50
50
|
class TISProtocolHandler:
|
|
51
51
|
OPERATION_CONTROL = [0x00, 0x31]
|
|
52
52
|
OPERATION_CONTROL_UPDATE = [0x00, 0x33]
|
|
53
|
-
|
|
53
|
+
OPERATION_GET_TEMP = [0xE3, 0xE7]
|
|
54
|
+
OPERATION_GET_LUX = [0x20, 0x24]
|
|
54
55
|
OPERATION_DISCOVERY = [0x00, 0x0E]
|
|
55
56
|
|
|
56
57
|
def __init__(self) -> None:
|
|
@@ -102,7 +103,7 @@ class TISProtocolHandler:
|
|
|
102
103
|
additional_bytes=[],
|
|
103
104
|
)
|
|
104
105
|
|
|
105
|
-
def
|
|
106
|
+
def generate_temp_sensor_update_packet(self, entity) -> TISPacket:
|
|
106
107
|
"""
|
|
107
108
|
Generate a packet to update the temperature sensor.
|
|
108
109
|
|
|
@@ -111,11 +112,26 @@ class TISProtocolHandler:
|
|
|
111
112
|
"""
|
|
112
113
|
return TISPacket(
|
|
113
114
|
device_id=entity.device_id,
|
|
114
|
-
operation_code=TISProtocolHandler.
|
|
115
|
+
operation_code=TISProtocolHandler.OPERATION_GET_TEMP,
|
|
115
116
|
source_ip=entity.api.host,
|
|
116
117
|
destination_ip=entity.gateway,
|
|
117
118
|
additional_bytes=[0x00],
|
|
118
119
|
)
|
|
120
|
+
|
|
121
|
+
def generate_lux_sensor_update_packet(self, entity) -> TISPacket:
|
|
122
|
+
"""
|
|
123
|
+
Generate a packet to update the lux sensor.
|
|
124
|
+
|
|
125
|
+
:param entity: The entity object containing device information.
|
|
126
|
+
:return: A Packet instance.
|
|
127
|
+
"""
|
|
128
|
+
return TISPacket(
|
|
129
|
+
device_id=entity.device_id,
|
|
130
|
+
operation_code=TISProtocolHandler.OPERATION_GET_LUX_TEMP,
|
|
131
|
+
source_ip=entity.api.host,
|
|
132
|
+
destination_ip=entity.gateway,
|
|
133
|
+
additional_bytes=[0x14, 0x00],
|
|
134
|
+
)
|
|
119
135
|
|
|
120
136
|
def generate_discovery_packet(self) -> TISPacket:
|
|
121
137
|
"""
|
|
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.2.7 → tiscontrolprotocol-0.2.9}/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
|
{tiscontrolprotocol-0.2.7 → tiscontrolprotocol-0.2.9}/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
|