添加测试代码
This commit is contained in:
@@ -546,6 +546,7 @@ class JackeryDataCoordinator:
|
||||
ts = int(time.time())
|
||||
|
||||
# 1. Poll Device Status (Type 25)
|
||||
try:
|
||||
payload_25 = {
|
||||
"type": 25,
|
||||
"eventId": 0,
|
||||
@@ -562,8 +563,11 @@ class JackeryDataCoordinator:
|
||||
0,
|
||||
False
|
||||
)
|
||||
except Exception as e:
|
||||
_LOGGER.warning(f"Error polling device status (Type 25): {e}")
|
||||
|
||||
# 2. Poll Sub-devices (Type 100) - CTs (2) and Plugs (6)
|
||||
try:
|
||||
for dev_type in [2, 6]:
|
||||
payload_100 = {
|
||||
"type": 100,
|
||||
@@ -584,6 +588,8 @@ class JackeryDataCoordinator:
|
||||
False
|
||||
)
|
||||
await asyncio.sleep(0.5) # Avoid spamming too fast
|
||||
except Exception as e:
|
||||
_LOGGER.warning(f"Error polling sub-devices (Type 100): {e}")
|
||||
|
||||
_LOGGER.debug(f"Sent poll requests (25 & 100 [2,6]) to {action_topic}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user