Closed SrvRpi closed 1 year ago
How to correctly describe HA sensors? Does REST return the correct JSON format?
sensor:
{"peer_1":"{"endpoint":xx.xx.xx.xx:51820,"latest_handshake":Thu Jun 8 11:14:28 EEST 2023,"transfer_rx":219000,"transfer_tx":86940}"}
Maybe it should return:
{"peer_1":{"endpoint":xx.xx.xx.xx:51820,"latest_handshake":Thu Jun 8 11:14:28 EEST 2023,"transfer_rx":219000,"transfer_tx":86940}}
And even better:
{"peer_1":{"endpoint":"xx.xx.xx.xx:51820","latest_handshake":"Thu Jun 8 11:14:28 EEST 2023","transfer_rx":"219000","transfer_tx":"86940"}}
Hi @SrvRpi thanks for this issue notification Anyway please feel free to create a PR with the suggested fix 👍 I could try to have the time to fix it but at moment I don't know when.
Thank you @olpal 🙌
How to correctly describe HA sensors? Does REST return the correct JSON format?
sensor:
{"peer_1":"{"endpoint":xx.xx.xx.xx:51820,"latest_handshake":Thu Jun 8 11:14:28 EEST 2023,"transfer_rx":219000,"transfer_tx":86940}"}
Maybe it should return:
{"peer_1":{"endpoint":xx.xx.xx.xx:51820,"latest_handshake":Thu Jun 8 11:14:28 EEST 2023,"transfer_rx":219000,"transfer_tx":86940}}
And even better:
{"peer_1":{"endpoint":"xx.xx.xx.xx:51820","latest_handshake":"Thu Jun 8 11:14:28 EEST 2023","transfer_rx":"219000","transfer_tx":"86940"}}