roleoroleo / sonoff-hack

Custom firmware for Sonoff GK-200MP2B camera
GNU General Public License v3.0
200 stars 45 forks source link

new dependency on cJSON? #111

Closed darkxst closed 1 year ago

darkxst commented 1 year ago

Hi @roleoroleo, I have been thinking about adding support for HA MQTT auto discovery. pulling in cJSON would make that much easier. Are you ok with adding an extra lib into the mix. As a plus this is also used by newer versions of Mosquitto to allow the client apps mosquitto_sub/mosquitto_pub to handle JSON messages also.

WIP branch that builds only the cJSON module so far is here https://github.com/darkxst/sonoff-hack/tree/cJSON. Lib seems to be pretty lightweight.

roleoroleo commented 1 year ago

No problems.

Did you take a look at this piece of code? https://github.com/roleoroleo/yi-hack-Allwinner-v2/tree/master/src/static/static/yi-hack/script/mqtt_advertise

darkxst commented 1 year ago

Did you take a look at this piece of code? https://github.com/roleoroleo/yi-hack-Allwinner-v2/tree/master/src/static/static/yi-hack/script/mqtt_advertise

yeh I have seen that, I dont plan on adding any telemetry data and the sonoff cams don't have many options in comparision. Will just be motion, motion_image and maybe later a couple of controls to adjust detection settings.

roleoroleo commented 1 year ago

Ok, no problem adding a new library. Because the code is on the sd card and there are no problem with the size of the hack.

darkxst commented 1 year ago

ok, I just sent through a pull request for the HA discovery stuff.

darkxst commented 1 year ago

Merged to master now.