Closed cristianchelu closed 4 months ago
Nice find, it's unfortunate that both commands return result
instead of the action
one e.g. action_result
.
Since the actions of my device just return a code, does this patch fix it?
0001-properly-parse-action-results.patch.txt
Works with your patch applied, without breaking other sensors.
[21:28:07][V][miot:171]: Sending reply 'down action 5 6' to MCU
[21:28:07][V][miot:091]: Received MCU message 'result 5 6 0 12 "0,255,255,255,255,1,255,255,255,255,2,8,0,5,0,3,255,255,255,255,4,255,255,255,255"'
[21:28:07][V][miot.text_sensor:011]: MCU reported text sensor 5:12 is: 0,255,255,255,255,1,255,255,255,255,2,8,0,5,0,3,255,255,255,255,4,255,255,255,255
[21:28:07][V][text_sensor:013]: 'Feed Plan': Received new state 0,255,255,255,255,1,255,255,255,255,2,8,0,5,0,3,255,255,255,255,4,255,255,255,255
[21:28:07][D][text_sensor:064]: 'Feed Plan': Sending state '0,255,255,255,255,1,255,255,255,255,2,8,0,5,0,3,255,255,255,255,4,255,255,255,255'
[21:28:07][V][miot:171]: Sending reply 'ok' to MCU
Nice, thanks for the test drive. Fix pushed to main
When we recieve a
result
message after dispatching anaction
, it's in a different form thanget_properties
/set_properties
/properties_changed
. More specifically, there is only oneSIID
, oneAIID
and onecode
, but then multiplepiid
+value
pairs belonging to the same service, and theupdate_properties
function expects the pairs to always besiid
+piid
I believe the same will happen for
event_changed
messages when those are implemented.For convenience: Get Properties Spec
Set Properties Spec
Properties Changed Spec
Action Spec
and Event Occurred Spec (With the same format as
action
)I pushed a fix in my repo here, but I'm a noob at C++ and figured you might have a better approach to this. I also didn't add the
event_occurred
case as I just realized the similarity while writing this issue.main branch:
My branch:
YAML (both):