anklimov / lighthub

Flexible, Arduino Mega/Due/ESP8266/ESP32/STM32 based SmartHome controller with DMX-512 in/out, 1-Wire, Modbus, MQTT interfaces. OpenHab/HomeAssistant/ioBroker compatible.
https://lazyhome.ru
Apache License 2.0
97 stars 23 forks source link

refactoring. help cmd improved. Removed newline from freeMem periodic… #10

Closed livello closed 6 years ago

livello commented 6 years ago

…al print.

anklimov commented 6 years ago

applyConfig better

And Pool to Poll of course

On Mar 22, 2018, at 10:06 PM, Sergey Konyukhov notifications@github.com wrote:

@livello commented on this pull request.

In lighthub/main.h https://github.com/anklimov/lighthub/pull/10#discussion_r176539129:

@@ -25,14 +25,14 @@ void Changed (int i, DeviceAddress addr, int val); void modbusIdle(void); void _handleHelp(int arg_cnt, char args); void _kill(int arg_cnt, char args); -void parseConfig(); +void parseConfigFromParsedJSON(); may be parseConfigFromValidatedJSON? But this name shows that json is already processed and now config parsed using prepared data.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/anklimov/lighthub/pull/10#discussion_r176539129, or mute the thread https://github.com/notifications/unsubscribe-auth/AVhOGcpo-VHCy8D4yzL5dBuntlCB48Irks5tg_YogaJpZM4S3jwL.

anklimov commented 6 years ago

rootConf ? Better to keep as is

On Mar 22, 2018, at 10:07 PM, Sergey Konyukhov notifications@github.com wrote:

@livello commented on this pull request.

In lighthub/main.cpp https://github.com/anklimov/lighthub/pull/10#discussion_r176539576:

 }

endif

  • items = aJson.getObjectItem(root,"items");
  • items = aJson.getObjectItem(aJsonObjectRoot, "items"); May be find some better name? Root is like a,b,c name. Doesn't say anything special.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/anklimov/lighthub/pull/10#discussion_r176539576, or mute the thread https://github.com/notifications/unsubscribe-auth/AVhOGdecnLT-rDi0gdesX6ktD2hi-VXsks5tg_Z9gaJpZM4S3jwL.

anklimov commented 6 years ago

.. And, finally, what reason to remove CR after FreeMem ??

livello commented 6 years ago

Log viewing comfort. Every new line with freeMem number fragment solid logs into peaces with many empty lines.

livello commented 6 years ago

commit added. https://github.com/anklimov/lighthub/pull/10/commits/bbf944c482999ef7c55e3eef61d045730cafd169

anklimov commented 6 years ago

832 Item:ktc T:4 =97 Modbus Val: D0E Item:gst T:4 =97 Item:fm T:9 =10 FM Val :41-0-0-0-0-0-0-0-0-143- PI Val :351-216-135--666- [/myhome/in/a_sasha] REST Item:a_sasha T:3 =7 Cmd=3 832 Item:bth1 T:4 =96 Modbus Val: 1F Item:bth2 T:4 =96 Item:ktc T:4 =97 Modbus Val: D0E Item:gst T:4 =97

Console log example I see no reasons to remove CR after “832” to avoid unreadable 832Item:bth1 T:4 =96

Mem:832

Will looks better if some improvement needed here

livello commented 6 years ago

2937 [/myhome/in/h_relay5] TOGGLE Item:h_relay5 T:5 =41 Cmd=4 /myhome/s_out/h_relay5->ON 2937 ␛[A2937 [/myhome/in/h_relay5] TOGGLE Item:h_relay5 T:5 =41 Cmd=4 /myhome/s_out/h_relay5->OFF 2937 [/myhome/in/h_relay4] TOGGLE Item:h_relay4 T:6 =39 Cmd=4 /myhome/s_out/h_relay4->OFF Pin:39=0 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937 2937

My logs look that way. May be because of semi empty configuration. What about publishing freeMem to MQTT instead of printing it?