Commit Graph

2982 Commits

Author SHA1 Message Date
Maxim Prokhorov
4d157ccd5b ha: discovery refactoring
- retain setting
- generate topic and message in the discovery object instead of
creating them all at once
- re-implement relays, lights and sensors discovery
- rework name normalization, use relative magnitude indexes
- replace original lights code with schema: json, subscribe to a special
topic to handle lights instead of using the common API
(still wip - colors, hs, temperature settings)

resolve #630
resolve #1564
resolve #2403
2021-01-26 01:02:49 +03:00
Maxim Prokhorov
0b43af8ed9 ha: fix build with current String implementation 2021-01-24 03:53:16 +03:00
Maxim Prokhorov
125ca6f9b3 rfm69: cleanup and bump version 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
e50b6fe79a mdns: clean-up 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
7ba1283024 mqtt: clean-up json queueing
- simply use a basic {String, String} struct
- fix MQTT_TOPIC_TIME vs. MQTT_TOPIC_DATETIME
- get rid of unused chaining and indexes
2021-01-24 03:38:02 +03:00
Maxim Prokhorov
f4726d9966 sys: default heartbeat mode to repeat 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
1960df21fb sys: some more header cleanup 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
1685b0350c sys: hide internal details from the header 2021-01-24 03:38:02 +03:00
Maxim Prokhorov
021f0afb86 sys: clean-up system-specific functions
- shrink utils source file, move heartbeat and boot management into system
- improvise with 'heartbeat' functionality. include scheduler implementation that will
manage the per-module heartbeat callbacks with individual 'mode' and
'interval' settings. current ones are mqtt (including relays, lights, thermostat), debug and
influxdb. preserve heartbeat NONE, ONCE and REPEAT, REPEAT_STATUS is effectively a hbReport & status bit.
- mqtt heartbeat is managed through mqttHeartbeat() callbacks
- tweak mqtt callbacks to use lists instead of the vector, slighly reducing the size of the .bin
- update WebUI, include report setting and update hbMode values
- make sure general.h settings include new heartbeat,
move constant definitions outside of the header
- correctly include dependencies through the .cpp, avoid leaking
internal details.
- as a side-effect, base headers are no longer included recursively
2021-01-24 03:38:02 +03:00
Maxim Prokhorov
c4f0ceb1ae sys: refactor custom reset codes 2021-01-23 21:28:01 +03:00
Maxim Prokhorov
660493a1db settings: fixup 4abcec8a2b
- for some reason old key was default-constructible
- fix magnitude key generation
2021-01-21 14:33:36 +03:00
Maxim Prokhorov
14da395724 rpn: update to support 64bit time_t
- specialize ntp functions to split time_t into 32bit ints when time_t is larger than rpn_int
- rework 'tick' variable into an operator that can be triggered once
- make sure operators expect new time_t split via argc of 2
2021-01-21 13:51:11 +03:00
Maxim Prokhorov
d6bd9ed993 ntp: pointless const 2021-01-21 13:51:11 +03:00
Maxim Prokhorov
c179467be2 ntp: do not override existing ntpTZ 2021-01-21 13:51:11 +03:00
Maxim Prokhorov
e8e58b821c ntp: more checks when using DHCP servers
- make sure server is never empty
- disable dhcp option when server *is* empty
- update configure() to detect both tz and server changes
2021-01-21 11:38:44 +03:00
Maxim Prokhorov
c9a951068b settings: fix gcc-4.8.2 builds 2021-01-21 10:00:52 +03:00
Maxim Prokhorov
071131260f pio: specify revision as prerelease 2021-01-20 23:39:28 +03:00
Maxim Prokhorov
7817e3abd5 pio: accept external revision string 2021-01-20 23:35:36 +03:00
Maxim Prokhorov
21b89efb4b settings: fallback to defaults when old cfg is detected 2021-01-20 21:15:54 +03:00
Maxim Prokhorov
4abcec8a2b settings: fix indirect conversions and getSetting specializations 2021-01-20 15:44:36 +03:00
Maxim Prokhorov
9eb39bfd86 settings: parse bool as string 2021-01-20 14:50:29 +03:00
Maxim Prokhorov
acf299582b relay: use helper type alias for the provider 2021-01-20 01:04:22 +03:00
Maxim Prokhorov
cef9547c19 relay: defaults for pulse mode and time
- allow strings in mode (off, on, none)
- fixup type used for the mode to be am enum instead of int
  (todo: allow webui to accept strings?)
- some cli updates using new funcs
2021-01-20 01:04:22 +03:00
Maxim Prokhorov
972188c83b fan: common types and actions
update custom action callback to also get the event
buttons fan actions
ifan buttons are handled through action instead of manually
fan settings and api are (sort-of) generic
2021-01-19 23:30:12 +03:00
Maxim Prokhorov
9317dbce5a hw: do not ask password change when using -core 2021-01-19 18:20:45 +03:00
Maxim Prokhorov
8e659c9486 relay: type is always valid
resolve #2416
2021-01-17 12:11:41 +03:00
Maxim Prokhorov
ca15752f3b pio: fixup generic build 2021-01-16 20:41:08 +03:00
Maxim Prokhorov
8df23392a9 webui: clean-up cfd6e36dbe
update to terser v5
replace gulp-remove-code with a rough equivalent in the gulpscript itself
replace gulp-inline with gulp-inline-source-html
remove base64 modules as redundant when running inline-source (does both)
remove crass as redundant when running inline-source (uses csso)
fixup jquery source map comment (but still keep the actual file)

at least now this seems stable enough to start more of the ui tweaking
2021-01-16 20:40:23 +03:00
Maxim Prokhorov
e7f97c09e4 webui: some more version bumps
pure-css 1.0.0 -> 2.0.3
datatable 1.10.16 -> 1.10.23
generic jquery-slim -> custom jquery/jquery@a32cf6324f slim build with an addition of -sizzle

does not seem to be breaking anything (yet)
2021-01-15 23:54:16 +03:00
Maxim Prokhorov
df24cf0036 webui: fix missing files and bump jquery 2021-01-15 23:18:15 +03:00
Maxim Prokhorov
3e0291e534 webui: bump old deps 2021-01-15 23:06:19 +03:00
Maxim Prokhorov
c6e2dbbc5a webui: show the actual error when compressJs fails
note that this does not show the correct error line b/c we filter this
through the remover() first
2021-01-15 22:46:55 +03:00
Maxim Prokhorov
808981ca39 webui: update colorpicker
ref. https://github.com/xoseperez/espurna/issues/1132#issuecomment-431868924
it is slightly bigger, but better looking and no jquery dependency

rework colorpicker style as well, hide to prevent sending garbage when
lights are off. update lights module to send `lightState()` and separate
state from status payloads

yes, input[type="color"] is an option, but it does not look good
2021-01-15 22:46:55 +03:00
Maxim Prokhorov
cfd6e36dbe webui: use terser as js minifier
support es6 syntax
use js comment style in custom.js
only minify the custom.js

using 4.x branch, since 5.x wants async / await and more changes to the gulp script
2021-01-15 22:45:44 +03:00
Maxim Prokhorov
3a34d555d5 ci: don't mention travis 2021-01-14 18:11:14 +03:00
Maxim Prokhorov
252b98e0f7 utils: make version string parsable by semver utils 2021-01-14 17:22:27 +03:00
Maxim Prokhorov
df0f1a2e19 ifan: make sure pin is initialized 2021-01-14 16:59:17 +03:00
Maxim Prokhorov
2223184c25 ifan: more fixes, clean-up relays 2021-01-14 16:51:16 +03:00
Maxim Prokhorov
ef194c9c24 button: custom action + ifan fixes 2021-01-14 15:24:08 +03:00
Maxim Prokhorov
a40eca30ad ifan: refactor into a separate module 2021-01-14 14:10:45 +03:00
Max Prokhorov
8ceeebdb24 providers: relays, lights and buttons refactoring (#2414)
- gpio module now tracks the known providers (right now, hardware and mcp expander)
- refactored relay struct to use 'Provider' implementing setup,notify,change,boot instead of just BasePin actions
- refactored button module to use gpio provider instead of referencing types itself
- removed dual & stm code from buttons, migrate both to relay module
- added status notify and change callbacks for relayStatus (i.e. 'notify' when relay status was called, but not changed. and 'changed' when it did)  
- relays runtime configuration keys
- relay command now shows configured relays and current & target statuses
- refactor the code using relayStatus(0, blah) under LIGHT_PROVIDER check to use lightState instead
- remove rfbridge code form relay module. implement through a basic state listener in the rfbridge module, depend on RELAY_SUPPORT
- allow to bind rf codes to real relays
- drop tuya-specific lights provider, remove tuya code from relays and lights modules
- integrate tuya via relay listeners and providers, use lights custom provider
- implement channel transitions for tuya. disabled by default, and transition time and step are overridden to 2000 + 100. needs to be set to some value below the total time (i.e. `total transition time / step time == number of steps`, we need to figure out a correct time that serial comms could handle)
- lights custom provider (global, not per-pin) and state listeners
- remove lights code from relay module. implement through providers & listeners in the lights module, depend on RELAY_SUPPORT
- lights per-channel relay provider (unused atm), depend on RELAY_SUPPORT
- refactored channel transition - calculate step only once, make sure time + step values are sane, generate quick transitions with very small delay (10ms hardcoded) for transitions during OFF state i.e. we no longer waste 500ms (or whatever transition time is set to) on boot doing nothing
- transition time + step parameter for the lightUpdate
- report mask parameter for the lightUpdate
- minor fixes across the board

resolve #2222
2021-01-14 10:39:18 +03:00
DmitryBlinov
c1243fda31 garland: updates (#2412)
- Update README.md - add garland description
- Add new animation - Dolphins
2021-01-14 10:36:32 +03:00
Maxim Prokhorov
2a2650f769 webui: fit title on one line 2021-01-04 06:27:03 +03:00
Maxim Prokhorov
29caf0036d wifi: yield after disconnecting 2021-01-04 06:25:44 +03:00
Maxim Prokhorov
f0f6f1b8c9 utils: simplify version + revision into just version 2021-01-04 06:05:04 +03:00
Maxim Prokhorov
3ba6011d49 ntp: fix build when ntp is disabled 2021-01-04 05:23:06 +03:00
Maxim Prokhorov
83edf629cc ntp: simplify uptime info, drop legacy timelib funcs & consts 2021-01-04 05:18:24 +03:00
Maxim Prokhorov
c100696f7b ws: correctly send 64bit time_t to the webui 2021-01-04 05:07:25 +03:00
Maxim Prokhorov
d04b85ac97 domoticz: send co2 ppm as nvalue
ref. https://gitter.im/tinkerman-cat/espurna?at=5ff1f6934eba353cdf164311
tnx @w00ty
2021-01-04 05:02:28 +03:00
Maxim Prokhorov
e7d92369fb pio: notice about macOS big sur 2021-01-04 05:01:14 +03:00