Commit Graph

3690 Commits

Author SHA1 Message Date
Maxim Prokhorov
b8921b9a89 bh1750: more decimals for mode2
return half of raw value in both modes involving it
resolve #2550 (just for the sensor, no global setting yet)
2022-12-04 05:56:18 +03:00
Maxim Prokhorov
bea8508ee2 v9261f: lazy parsing
ref. #2483, #2546 and #2554
instead of waiting for our time window, attempt to read & parse everything
discard unknown data more frequently, and attempt to store more data as well
2022-12-04 05:53:21 +03:00
Maxim Prokhorov
ae0ae0b0d4 hw: formatting 2022-12-01 01:14:04 +03:00
Maxim Prokhorov
3f0366d910 hw: uart can be disabled with a specific flag
resolve #2558
resolve #2559
2022-12-01 01:11:22 +03:00
Maxim Prokhorov
00927fa412 relay: unused interface 2022-12-01 00:31:38 +03:00
Maxim Prokhorov
e70503a412 relay: destructor can be defaulted 2022-12-01 00:30:29 +03:00
Maxim Prokhorov
d1fabbd166 rtcmem: increment is u32 2022-12-01 00:30:29 +03:00
Maxim Prokhorov
59c2e97e0a webui: rebuild blobs 2022-12-01 00:30:29 +03:00
Maxim Prokhorov
0d8be5af99 ha: topic is always the same 2022-12-01 00:30:29 +03:00
Maxim Prokhorov
9126a9832b light: cct for rgb, rgbww and ww cases
- revert to ignoring rgb in color+white+cct case by resetting all its
  inputs to minimum and only controlling white channels
- ignore ww and cw in rgb+cct case; use approximated color, thus allowing
  us to set a different 'cold temperature' limit
- fix webui layout rules based on root element class(es) and consistent
  order for our control elements that does not depend on the order in which
  `processData` handles configuration kvs
- internal refactoring to flatten input processing funcs selection
  (to possibly replace our boolean flags with a simple list)
2022-12-01 00:30:26 +03:00
Maxim Prokhorov
4021c4d14d light: hide colorpicker when color is disabled 2022-11-27 03:43:41 +03:00
Maxim Prokhorov
d664b9d45d pwm: 1000hz -> 500hz to retain backwards compat
...and since it still causes hwdt crashes
2022-11-25 11:27:35 +03:00
Maxim Prokhorov
824e121499 relay: try to preserve state on reboot
ref. #2547, tell gpio side that we don't need any init

may do weird stuff after runtime pin changes, since we won't know our
new pins due to the order of setup() functions
2022-11-25 11:26:47 +03:00
Maxim Prokhorov
d78d783521 relay: unwanted pin write on init 2022-11-25 11:26:40 +03:00
Maxim Prokhorov
5a74dc146e doc: simple offsets with generic syntax
same as original fix for the Core
fix footer into a single line and add UTC alias notice
2022-11-25 09:46:38 +03:00
Maxim Prokhorov
144f2a7297 hw: warm white channel is first 2022-11-25 05:14:26 +03:00
Maxim Prokhorov
b1bdfd927c webui: update blobs 2022-11-25 05:09:12 +03:00
Maxim Prokhorov
83e7b61ce9 light: mired range in terminal 2022-11-25 05:07:46 +03:00
Maxim Prokhorov
33453117a4 light: fix temperature scale and white channel mode
make use of our apply() objects for value replacement in-place
also revert the white channel mode change that ignores rgb output factor
2022-11-25 05:06:10 +03:00
Maxim Prokhorov
99b5ed9b57 webui: normalize light channel tags 2022-11-25 05:04:25 +03:00
Maxim Prokhorov
d029414f6e webui: always display brightness 2022-11-25 05:03:58 +03:00
Maxim Prokhorov
909b2a0786 webui: lights styling through classes 2022-11-25 05:03:29 +03:00
Maxim Prokhorov
e84fbf7366 webui: correct TZ yet again
amends 94f0786ed5
2022-11-17 23:05:40 +03:00
Maxim Prokhorov
ad603aa2c3 light: another ambiguous type 2022-11-17 23:02:22 +03:00
Maxim Prokhorov
a437371408 light: ambiguous numeric type 2022-11-17 23:02:14 +03:00
Maxim Prokhorov
94f0786ed5 webui: simple tz could either be with hyphen or without
looking at <...> TZ values, previous version seemed true
2022-11-17 17:23:06 +03:00
Maxim Prokhorov
70d25aea06 webui: ntp offsets from tzdata/etcetera
refer to our docs for the script output
see #2548
2022-11-17 01:46:51 +03:00
Maxim Prokhorov
fcbc57c885 util: fix non-arduino api 2022-11-17 00:54:10 +03:00
Maxim Prokhorov
45c54863ba light: report disabled relay support 2022-11-17 00:54:10 +03:00
Maxim Prokhorov
f37f380c04 webui: 2nd try at using css for light controls
register channels with their respective tags, instead of using count
both on backend and frontend

revert to useCCT mireds slider rule, disallow white channels with useWhite
2022-11-17 00:54:10 +03:00
Maxim Prokhorov
1be7623143 webui: emon hints visibility through css 2022-11-17 00:54:10 +03:00
Maxim Prokhorov
2586b54411 sns: v9261f reactive power from apparent
resolve #2554

make use of cse7766 calculation for factor, too
thanks to @Kaan88

remove reactive power ratio from base sensor as well, since it does not
seem to be used anywhere else (...and does not really make sense in most
situations when sensor inputs are using common gain)
2022-11-17 00:54:10 +03:00
Maxim Prokhorov
6fe04a49e7 system: common case could sleep for the timeout duration 2022-11-17 00:54:10 +03:00
Maxim Prokhorov
22791cfc86 system: blocking delay should actually call delay()
avoid optimizing out function call when `&&` comparison is always false
resolve #2555
2022-11-17 00:54:10 +03:00
Maxim Prokhorov
a3d8582a70 sns: flush does not mean reset for both tx and rx
* clean-up useless stream read() / flush(), rely on timer and internal state
  avoids wdt reset with sensors looping on available()
* fix some instances of `available()` in boolean context to use `>0`
  (not everything returns sign, but if it does - we are in trouble)
* util func to read available bytes from the stream using buffered
  interface instead of 1 byte at a time
2022-11-17 00:54:10 +03:00
Maxim Prokhorov
441454d931 light: mireds as another input value
color temperature applies to input values as and / or
- rgb channels scale, when cct mode is enabled w/ color
- white channel(s), moving between warm and cold

remove two rgb scalers applied one after the other in favour of two
distinct variants - we either subtract common value from rgb or use
mireds as a scale for both rgb and ww+cw
restore brightness control as well
2022-11-17 00:54:10 +03:00
ktkd
1169be25a5 sns: fix slash removal in modules (#2552)
fix invalid prometheus syntax `strconv.ParseFloat: parsing "/0": invalid syntax`
fix another instance of remove('/')
2022-11-07 19:10:12 +03:00
Maxim Prokhorov
079c4305c0 light: limit comma separated payloads
rgb only applies to the first 3, group applies to all
2022-11-05 04:08:56 +03:00
Maxim Prokhorov
5577d8bb42 light: group payload is comma separated 2022-11-05 03:32:58 +03:00
Maxim Prokhorov
c4d3c57e80 light: ws channel data is text 2022-11-05 03:27:45 +03:00
Maxim Prokhorov
29af260d34 debug: sometimes uart is disabled 2022-11-05 02:59:12 +03:00
Maxim Prokhorov
c99118e294 ws: yet another json buffer overflow 2022-11-04 19:35:04 +03:00
Maxim Prokhorov
cc90554b0e sns: redefinable bh1750 mode 2022-11-03 18:13:39 +03:00
Maxim Prokhorov
03ed94b771 light: try generic provider once again
avoid going out-of-bounds in phases loop
small adjustments to the variable loading
2022-11-02 04:36:49 +03:00
Maxim Prokhorov
7bda67a06c ws: fix off-by-one when parsing input
notice about buffering and its impact
and avoid using strcmp, just compare bytes
2022-10-30 00:51:23 +03:00
Maxim Prokhorov
7296eca22e ws: do not print raw data
* error code is not buffered through our handler object.
  while espasync code does strlen, what it returns is mostly random.
  (old request parts, weird data, etc.)
* reworked buffer class to avoid an extra allocation on top of the
  existing vector data buffer. plus, simple function pointer as well
2022-10-30 00:50:05 +03:00
Maxim Prokhorov
f1d5b62146 light: webui color and cct fixes
* correct id=... and element references, partial changes to element
  order were not using the new global 'light' container
* separate block for picker, does not seem consistent to depend on json
  key order when processing device cfg
* visibility != display; make sure color picker is hidden when there is
  no color control, but not visible when color is on but state is off
2022-10-29 02:08:50 +03:00
Maxim Prokhorov
fce3adf2b2 system: revert 657061bf completely
disarm is *required* by the underlying API, don't miss it on start()
while the func uses a resource lock internally, it does not seem to be the
source of system lock-ups encountered so far
2022-10-27 18:37:20 +03:00
Maxim Prokhorov
c01a192756 hw: fix lightfox builds 2022-10-27 17:26:27 +03:00
Maxim Prokhorov
9aa91bf022 uart: allow to claim unused hw pins with sw
prioritize hw instead of straight up removing the choice to create a sw
object. for example, allow to use either of the swapped UART0 pins when
we already use the main ones
2022-10-27 03:57:54 +03:00