Closed ov1d1u closed 9 months ago
Sounds like a write_multiple command would need to be created for this situation.
I don't think this is the ideal approach, as sometimes you might need to write - read - write something in the same session.
We should define something that could be used by other gateways like Theengs. We could have a json with a list commands for a specific mac:
Specifically for this device something like sending a list of payload would work, e.g.:
[
{
"ble_write_address": "58:2D:34:55:8A:87",
"ble_write_service": "22210000-554a-4546-5542-46534450464d",
"ble_write_char": "00000001-0000-1000-8000-00805f9b34fb",
"ble_write_value": "1101ea600e964287ea7d17894900da6174bd",
"value_type": "HEX",
"ttl": 4,
"immediate": true
},
{
"ble_write_address": "58:2D:34:55:8A:87",
"ble_write_service": "22210000-554a-4546-5542-46534450464d",
"ble_write_char": "00000001-0000-1000-8000-00805f9b34fb",
"ble_write_value": "0509b9414265",
"value_type": "HEX",
"ttl": 4,
"immediate": true
},
]
although it might not be ideal for other purposes, like when you need to read something from a characteristic between two writes.
This issue is stale because it has been open for 90 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Is your feature request related to a problem? Please describe. Some devices, like Qingping CGD1 require a sequence of data to be written on a characteristic. For example, to change the time on this clock you need to write an auth key on a specific characteristic and then a command on the same characteristic. Writing the auth key, disconnecting and then writing the command will not work.
Describe the solution you'd like To prevent breaking the current implementation, maybe a map of [MAC : flag] to enable/disable automatic connection management for each device should be kept. Aside from that, we will need two new endpoints to the
/commands/MQTTtoBT/config
to connect/disconnect from a specific deviceDescribe alternatives you've considered Right now I'm using an ESPHome configuration to control this clock, but there is no way in ESPHome to read a characteristic by request.