TISControlProtocol 1.0.61__tar.gz → 1.0.63__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-1.0.61 → tiscontrolprotocol-1.0.63}/.gitignore +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/.vscode/c_cpp_properties.json +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/.vscode/launch.json +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/.vscode/settings.json +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/.vscode/tasks.json +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/LICENSE +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/MANIFEST.in +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/PKG-INFO +1 -1
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/README.md +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/dev/pump_version.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/pyproject.toml +1 -1
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/BytesHelper.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/__init__.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/AckCoordinator.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketDispatcher.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketExtractor.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/AnalogFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/AutoBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/BinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateControlFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ControlResponseHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/DiscoveryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/EnergyFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/FloorBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/HealthFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/LunaTempFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/RealTimeFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/SearchResponseHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/SecurityFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/UpdateResponseHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/UpdateSecurityHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/WeatherFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketHandlers/__init__.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketProtocol.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketReceiver.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/PacketSender.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/ProtocolHandler.py +27 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/UpdateCoordinator.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/Protocols/udp/__init__.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/__init__.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/api.py +4 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/__init__.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/bill_config_endpoint.py +16 -4
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/change_password_endpoint.py +12 -2
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/get_bill_config_endpoint.py +12 -2
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/get_key_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/password_dashboard.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/password_form_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/passwords_endpoint.py +4 -3
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/restart_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/scan_devices_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/shared.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/submit_password.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/tis_endpoint.py +3 -1
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/update_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/crc.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/logo.png +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/package-lock.json +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/package.json +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/postcss.config.mjs +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/public/__init__.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/public/dashboard.css +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/public/password_dashboard_loader.js +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/shared.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/views/__init__.py +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/views/password_dashboard/index.html +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/views/password_dashboard/styles.css +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/views/password_form/index.html +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/views/password_form/styles.css +0 -0
- {tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/tests/test.py +0 -0
|
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-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/BytesHelper.py
RENAMED
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -260,6 +260,33 @@ class TISProtocolHandler:
|
|
|
260
260
|
),
|
|
261
261
|
)
|
|
262
262
|
|
|
263
|
+
def generate_dali_light_control_packet(
|
|
264
|
+
self, entity, brightness: int, temperature: int
|
|
265
|
+
) -> tuple[TISPacket, TISPacket]:
|
|
266
|
+
"""
|
|
267
|
+
Generate packets to control a DALI light.
|
|
268
|
+
:param entity: The entity object containing device information.
|
|
269
|
+
:param brightness: An integer representing the brightness level.
|
|
270
|
+
:param temperature: An integer representing the temperature level.
|
|
271
|
+
:return: A tuple of Packet instances.
|
|
272
|
+
"""
|
|
273
|
+
return (
|
|
274
|
+
TISPacket(
|
|
275
|
+
device_id=entity.device_id,
|
|
276
|
+
operation_code=TISProtocolHandler.OPERATION_CONTROL,
|
|
277
|
+
source_ip=entity.api.host,
|
|
278
|
+
destination_ip=entity.gateway,
|
|
279
|
+
additional_bytes=[entity.brightness_channel, brightness, 0x00, 0x00],
|
|
280
|
+
),
|
|
281
|
+
TISPacket(
|
|
282
|
+
device_id=entity.device_id,
|
|
283
|
+
operation_code=TISProtocolHandler.OPERATION_CONTROL,
|
|
284
|
+
source_ip=entity.api.host,
|
|
285
|
+
destination_ip=entity.gateway,
|
|
286
|
+
additional_bytes=[entity.temperature_channel, temperature, 0x00, 0x00],
|
|
287
|
+
),
|
|
288
|
+
)
|
|
289
|
+
|
|
263
290
|
def generate_no_pos_cover_packet(
|
|
264
291
|
self, entity, mode: Literal["open", "close", "stop"]
|
|
265
292
|
) -> tuple[TISPacket, TISPacket]:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -125,6 +125,8 @@ class TISApi:
|
|
|
125
125
|
if self.hass.services.has_service(self.domain, "send_cms_data"):
|
|
126
126
|
return
|
|
127
127
|
|
|
128
|
+
logging.info("Registering CMS data service")
|
|
129
|
+
|
|
128
130
|
async def handle_cms_data(call):
|
|
129
131
|
data = call.data.get("data", None)
|
|
130
132
|
|
|
@@ -172,6 +174,8 @@ class TISApi:
|
|
|
172
174
|
if self.hass.services.has_service(self.domain, "send_cms_data"):
|
|
173
175
|
self.hass.services.async_remove(self.domain, "send_cms_data")
|
|
174
176
|
|
|
177
|
+
logging.info("CMS data service unregistered")
|
|
178
|
+
|
|
175
179
|
if getattr(self, "_cms_task_unsub", None):
|
|
176
180
|
self._cms_task_unsub()
|
|
177
181
|
self._cms_task_unsub = None
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/__init__.py
RENAMED
|
File without changes
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
from homeassistant.components.http import HomeAssistantView
|
|
2
|
-
from aiohttp import web
|
|
3
1
|
import asyncio
|
|
2
|
+
import ipaddress
|
|
3
|
+
import json
|
|
4
4
|
import logging
|
|
5
5
|
import os
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import aiofiles
|
|
8
|
+
from aiohttp import web
|
|
9
|
+
from homeassistant.components.http import HomeAssistantView
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
class BillConfigEndpoint(HomeAssistantView):
|
|
@@ -18,6 +20,14 @@ class BillConfigEndpoint(HomeAssistantView):
|
|
|
18
20
|
self.tis_api = tis_api
|
|
19
21
|
|
|
20
22
|
async def post(self, request):
|
|
23
|
+
remote_ip = ipaddress.ip_address(request.remote)
|
|
24
|
+
is_local = remote_ip.is_private or remote_ip.is_loopback
|
|
25
|
+
|
|
26
|
+
if not is_local:
|
|
27
|
+
return web.json_response(
|
|
28
|
+
{"error": "Unauthorized: Local network access only"}, status=403
|
|
29
|
+
)
|
|
30
|
+
|
|
21
31
|
try:
|
|
22
32
|
data = await request.json()
|
|
23
33
|
|
|
@@ -51,5 +61,7 @@ class BillConfigEndpoint(HomeAssistantView):
|
|
|
51
61
|
|
|
52
62
|
async def reload_platforms(self):
|
|
53
63
|
# Reload the platforms
|
|
54
|
-
for entry in self.tis_api.hass.config_entries.async_entries(
|
|
64
|
+
for entry in self.tis_api.hass.config_entries.async_entries(
|
|
65
|
+
self.tis_api.domain
|
|
66
|
+
):
|
|
55
67
|
await self.tis_api.hass.config_entries.async_reload(entry.entry_id)
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
from homeassistant.components.http import HomeAssistantView
|
|
2
|
-
from aiohttp import web
|
|
3
1
|
import asyncio
|
|
2
|
+
import ipaddress
|
|
4
3
|
import logging
|
|
5
4
|
|
|
5
|
+
from aiohttp import web
|
|
6
|
+
from homeassistant.components.http import HomeAssistantView
|
|
7
|
+
|
|
6
8
|
|
|
7
9
|
class ChangeSecurityPassEndpoint(HomeAssistantView):
|
|
8
10
|
"""Change Security Password API Endpoint."""
|
|
@@ -15,6 +17,14 @@ class ChangeSecurityPassEndpoint(HomeAssistantView):
|
|
|
15
17
|
self.tis_api = tis_api
|
|
16
18
|
|
|
17
19
|
async def post(self, request):
|
|
20
|
+
remote_ip = ipaddress.ip_address(request.remote)
|
|
21
|
+
is_local = remote_ip.is_private or remote_ip.is_loopback
|
|
22
|
+
|
|
23
|
+
if not is_local:
|
|
24
|
+
return web.json_response(
|
|
25
|
+
{"error": "Unauthorized: Local network access only"}, status=403
|
|
26
|
+
)
|
|
27
|
+
|
|
18
28
|
try:
|
|
19
29
|
old_pass = request.query.get("old_pass")
|
|
20
30
|
new_pass = request.query.get("new_pass")
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
from aiohttp import web
|
|
1
|
+
import ipaddress
|
|
3
2
|
import logging
|
|
4
3
|
|
|
4
|
+
from aiohttp import web
|
|
5
|
+
from homeassistant.components.http import HomeAssistantView
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
class GetBillConfigEndpoint(HomeAssistantView):
|
|
7
9
|
"""Get Bill Configurations"""
|
|
@@ -14,6 +16,14 @@ class GetBillConfigEndpoint(HomeAssistantView):
|
|
|
14
16
|
self.tis_api = tis_api
|
|
15
17
|
|
|
16
18
|
async def get(self, request):
|
|
19
|
+
remote_ip = ipaddress.ip_address(request.remote)
|
|
20
|
+
is_local = remote_ip.is_private or remote_ip.is_loopback
|
|
21
|
+
|
|
22
|
+
if not is_local:
|
|
23
|
+
return web.json_response(
|
|
24
|
+
{"error": "Unauthorized: Local network access only"}, status=403
|
|
25
|
+
)
|
|
26
|
+
|
|
17
27
|
try:
|
|
18
28
|
if self.tis_api.bill_configs:
|
|
19
29
|
configs = self.tis_api.bill_configs
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
from homeassistant.components.http import HomeAssistantView
|
|
2
|
-
from aiohttp import web
|
|
3
|
-
import logging
|
|
4
1
|
import asyncio
|
|
2
|
+
import logging
|
|
3
|
+
|
|
4
|
+
from aiohttp import web
|
|
5
|
+
from homeassistant.components.http import HomeAssistantView
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
class PasswordsEndpoint(HomeAssistantView):
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/shared.py
RENAMED
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/apis/tis_endpoint.py
RENAMED
|
@@ -37,7 +37,7 @@ class TISEndPoint(HomeAssistantView):
|
|
|
37
37
|
|
|
38
38
|
# Parse the JSON data from the request body
|
|
39
39
|
try:
|
|
40
|
-
data = await request.json()
|
|
40
|
+
data: dict = await request.json()
|
|
41
41
|
except Exception:
|
|
42
42
|
return web.json_response({"error": "Invalid JSON"}, status=400)
|
|
43
43
|
|
|
@@ -56,6 +56,8 @@ class TISEndPoint(HomeAssistantView):
|
|
|
56
56
|
_LOGGER.warning("Unauthorized")
|
|
57
57
|
return web.json_response({"error": "Unauthorized"}, status=403)
|
|
58
58
|
|
|
59
|
+
data.pop("mac_address", None) # Remove MAC from data to avoid confusion.
|
|
60
|
+
|
|
59
61
|
# 3. Process the valid request
|
|
60
62
|
directory = "/config/custom_components/tis_integration/"
|
|
61
63
|
await self.api.save_appliances(data, directory)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/package-lock.json
RENAMED
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/postcss.config.mjs
RENAMED
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/public/__init__.py
RENAMED
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/public/dashboard.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.61 → tiscontrolprotocol-1.0.63}/src/TISControlProtocol/views/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|