Add onStats message#922
Conversation
| class GetOnStats(OnStats, JsonCommandWithMessageHandling): | ||
| """Get onStats command.""" | ||
|
|
||
| NAME = "getOnStats" |
There was a problem hiding this comment.
Are you sure this is a valid command? Did you test your code?
There was a problem hiding this comment.
I didn’t test this code, I’ve no idea on how to test it on my T9.
Is there a way to gather the command list directly from the device ?
anyway, I added it to have a command into device’s capability, otherwise I’ve no idea on how to “link” mqtt data to the device’s class, can you point me on how to do that?
There was a problem hiding this comment.
Is there a way to gather the command list directly from the device ?
Unfortunately not. We can only use trial and error.
You can checkout the example of the readme and test if you get an answer from your bot to test the command
There was a problem hiding this comment.
I've removed this command, because those stats come from mqtt topic "iot/atr/onStats/" and I've seen device subscribes to topics; let me know if commands are needed to handle mqtt messages.
Co-authored-by: Robert Resch <robert@resch.dev>
Co-authored-by: Robert Resch <robert@resch.dev>
test data comes from logs on gh issue; other fields are filtered out for now to not change StatsEvent dataclass.
added |
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
Codecov ReportAll modified and coverable lines are covered by tests ✅
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## dev #922 +/- ##
==========================================
+ Coverage 93.03% 93.07% +0.03%
==========================================
Files 126 127 +1
Lines 4899 4927 +28
Branches 318 320 +2
==========================================
+ Hits 4558 4586 +28
Misses 282 282
Partials 59 59 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
CodSpeed Performance ReportMerging #922 will not alter performanceComparing Summary
|
|
pre-commit.ci autofix |
for more information, see https://pre-commit.ci
edenhaus
left a comment
There was a problem hiding this comment.
Thanks @gpongelli 👍
I reverted the capabilities file changes as if they are still needed should go into a new PR
changes to handle onStats mqtt message
[deebot_client.mqtt_client] Got message: topic=iot/atr/onStats/f266fb63-5747-4cca-b8fb-3c1ceda9bd3f/659yh8/r7j2/j, payload=b'{"header":{"pri":1,"tzm":480,"ts":"1745398159530","ver":"0.0.1","fwVer":"1.4.9","hwVer":"0.1.1"},"body":{"data":{"area":27,"time":2459,"cid":"105534963","start":"1745395672","type":"auto","enablePowerMop":1,"powerMopType":2,"aiopen":1,"aitypes":[9],"avoidCount":1}}}'please let me know how can I test the changes on my deebot T9 AIVI, thanks.
closes #592