This commit is contained in:
@@ -400,7 +400,8 @@ class JackeryCoordinator:
|
|||||||
|
|
||||||
msg_type = raw.get("type")
|
msg_type = raw.get("type")
|
||||||
body = raw.get("body")
|
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:
|
try:
|
||||||
if msg_type == 101:
|
if msg_type == 101:
|
||||||
@@ -543,6 +544,16 @@ class JackeryCoordinator:
|
|||||||
}), 0, False,
|
}), 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):
|
for dev_type in (2, 6):
|
||||||
await ha_mqtt.async_publish(
|
await ha_mqtt.async_publish(
|
||||||
self.hass, self._action_topic,
|
self.hass, self._action_topic,
|
||||||
|
|||||||
Reference in New Issue
Block a user