From 33d5aca6ad527594591a26da881e5c8fc712a689 Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 3 Mar 2024 17:50:35 -0500 Subject: [PATCH] feat: add nonce to diagnostic data --- roborock/api.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/roborock/api.py b/roborock/api.py index 91f7a06..86d2a71 100644 --- a/roborock/api.py +++ b/roborock/api.py @@ -3,6 +3,7 @@ from __future__ import annotations import asyncio +import base64 import dataclasses import hashlib import json @@ -156,7 +157,9 @@ def __init__(self, endpoint: str, device_info: DeviceData, queue_timeout: int = self._last_device_msg_in = self.time_func() self._last_disconnection = self.time_func() self.keep_alive = KEEPALIVE - self._diagnostic_data: dict[str, dict[str, Any]] = {} + self._diagnostic_data: dict[str, dict[str, Any]] = { + "misc_info": {"Nonce": base64.b64encode(self._nonce).decode("utf-8")} + } self._logger = RoborockLoggerAdapter(device_info.device.name, _LOGGER) self.cache: dict[CacheableAttribute, AttributeCache] = { cacheable_attribute: AttributeCache(attr, self) for cacheable_attribute, attr in get_cache_map().items()