add polling for endpoint 23
Some checks failed
Validate / Validate (push) Has been cancelled

This commit is contained in:
2026-05-31 12:39:23 +02:00
parent ca1b870b89
commit b7e13b73a5

View File

@@ -400,7 +400,8 @@ class JackeryCoordinator:
msg_type = raw.get("type")
body = raw.get("body")
_LOGGER.info("Jackery %s: received type=%s on %s", self.device_sn, msg_type, msg.topic)
keys = list(body.keys()) if isinstance(body, dict) else body
_LOGGER.info("Jackery %s: received type=%s keys=%s", self.device_sn, msg_type, keys)
try:
if msg_type == 101:
@@ -543,6 +544,16 @@ class JackeryCoordinator:
}), 0, False,
)
# Request energy statistics
await ha_mqtt.async_publish(
self.hass, self._action_topic,
json.dumps({
"type": 23, "eventId": 0,
"messageId": random.randint(1000, 9999),
"ts": ts, "token": self._token, "body": None,
}), 0, False,
)
for dev_type in (2, 6):
await ha_mqtt.async_publish(
self.hass, self._action_topic,