bigmoby / addon-wireguard-client

Hassio Add-On Wireguard Client
MIT License
66 stars 24 forks source link

JSON format #27

Closed SrvRpi closed 1 year ago

SrvRpi commented 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"}}

bigmoby commented 1 year ago

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.

bigmoby commented 1 year ago

Thank you @olpal 🙌