Skip to content

Commit 3139f52

Browse files
committed
Merge remote-tracking branch 'origin/ac_main' into mdev
2 parents c708d27 + b241872 commit 3139f52

File tree

18 files changed

+2865
-2268
lines changed

18 files changed

+2865
-2268
lines changed

platformio.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
; MoonModules entries
4040
; ===================
4141

42-
default_envs = esp32_4MB_min, esp32_4MB_max, esp32_16MB_max, esp8266_4MB_min, esp32_4MB_PSRAM_max, esp32S3_8MB_max, wemos_shield_esp32_4MB_max, wemos_shield_esp32_4MB_ICS4343x_max, wemos_shield_esp32_4MB_SPM1423_max, wemos_shield_esp32_4MB_LineIn_max, wemos_shield_esp32_16MB_max, , wemos_shield_esp32_16MB_ICS4343x_max, wemos_shield_esp32_16MB_SPM1423_max, wemos_shield_esp32_16MB_LineIn_max, esp32_pico_4MB_max
42+
; default_envs = esp32_4MB_min, esp32_4MB_max, esp32_16MB_max, esp8266_4MB_min, esp32_4MB_PSRAM_max, esp32S3_8MB_max, wemos_shield_esp32_4MB_max, wemos_shield_esp32_4MB_ICS4343x_max, wemos_shield_esp32_4MB_SPM1423_max, wemos_shield_esp32_4MB_LineIn_max, wemos_shield_esp32_16MB_max, , wemos_shield_esp32_16MB_ICS4343x_max, wemos_shield_esp32_16MB_SPM1423_max, wemos_shield_esp32_16MB_LineIn_max, esp32_pico_4MB_max
4343
; default_envs = esp32_4MB_min
44-
; default_envs = esp32_4MB_max ; recommended default
44+
default_envs = esp32_4MB_max ; recommended default
4545
; default_envs = esp32_16MB_max
4646
; default_envs = esp8266_4MB_min
4747
; default_envs = esp32_4MB_V4_min

usermods/customeffects/arti_wled.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -169,13 +169,13 @@ float ARTI::arti_external_function(uint8_t function, float par1, float par2, flo
169169
return floatNull;
170170
}
171171
case F_circle2D: {
172-
uint16_t circleLength = min(strip.matrixWidth, strip.matrixHeight);
172+
uint16_t circleLength = min(Segment::maxWidth, Segment::maxHeight);
173173
uint16_t deltaWidth=0, deltaHeight=0;
174174

175-
if (circleLength < strip.matrixHeight) //portrait
176-
deltaHeight = (strip.matrixHeight - circleLength) / 2;
177-
if (circleLength < strip.matrixWidth) //portrait
178-
deltaWidth = (strip.matrixWidth - circleLength) / 2;
175+
if (circleLength < Segment::maxHeight) //portrait
176+
deltaHeight = (Segment::maxHeight - circleLength) / 2;
177+
if (circleLength < Segment::maxWidth) //portrait
178+
deltaWidth = (Segment::maxWidth - circleLength) / 2;
179179

180180
float halfLength = (circleLength-1)/2.0;
181181

@@ -524,8 +524,8 @@ bool ARTI::loop()
524524
for (int i = 0; i< arti_get_external_variable(F_ledCount); i++)
525525
{
526526
if (function_symbol->function_scope->nrOfFormals == 2) {// 2D
527-
ar->set(function_symbol->function_scope->symbols[0]->scope_index, i%strip.matrixWidth); // set x
528-
ar->set(function_symbol->function_scope->symbols[1]->scope_index, i/strip.matrixWidth); // set y
527+
ar->set(function_symbol->function_scope->symbols[0]->scope_index, i%Segment::maxWidth); // set x
528+
ar->set(function_symbol->function_scope->symbols[1]->scope_index, i/Segment::maxWidth); // set y
529529
}
530530
else
531531
ar->set(function_symbol->function_scope->symbols[0]->scope_index, i); // set x

usermods/sht/readme.md

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# SHT
2+
Usermod to support various SHT i2c sensors like the SHT30, SHT31, SHT35 and SHT85
3+
4+
## Requirements
5+
* "SHT85" by Rob Tillaart, v0.2 or higher: https://github.com/RobTillaart/SHT85
6+
7+
## Usermod installation
8+
Simply copy the below block (build task) to your `platformio_override.ini` and compile WLED using this new build task. Or use an existing one, add the buildflag `-D USERMOD_SHT` and the below library dependencies.
9+
10+
ESP32:
11+
```
12+
[env:custom_esp32dev_usermod_sht]
13+
extends = env:esp32dev
14+
build_flags = ${common.build_flags_esp32}
15+
-D USERMOD_SHT
16+
lib_deps = ${esp32.lib_deps}
17+
robtillaart/SHT85@~0.3.3
18+
```
19+
20+
ESP8266:
21+
```
22+
[env:custom_d1_mini_usermod_sht]
23+
extends = env:d1_mini
24+
build_flags = ${common.build_flags_esp8266}
25+
-D USERMOD_SHT
26+
lib_deps = ${esp8266.lib_deps}
27+
robtillaart/SHT85@~0.3.3
28+
```
29+
30+
## MQTT Discovery for Home Assistant
31+
If you're using Home Assistant and want to have the temperature and humidity available as entities in HA, you can tick the "Add-To-Home-Assistant-MQTT-Discovery" option in the usermod settings. If you have an MQTT broker configured under "Sync Settings" and it is connected, the mod will publish the auto discovery message to your broker and HA will instantly find it and create an entity each for the temperature and humidity.
32+
33+
### Publishing readings via MQTT
34+
Regardless of having MQTT discovery ticked or not, the mod will always report temperature and humidity to the WLED MQTT topic of that instance, if you have a broker configured and it's connected.
35+
36+
## Configuration
37+
Navigate to the "Config" and then to the "Usermods" section. If you compiled WLED with `-D USERMOD_SHT`, you will see the config for it there:
38+
* SHT-Type:
39+
* What it does: Select the SHT sensor type you want to use
40+
* Possible values: SHT30, SHT31, SHT35, SHT85
41+
* Default: SHT30
42+
* Unit:
43+
* What it does: Select which unit should be used to display the temperature in the info section. Also used when sending via MQTT discovery, see below.
44+
* Possible values: Celsius, Fahrenheit
45+
* Default: Celsius
46+
* Add-To-HA-MQTT-Discovery:
47+
* What it does: Makes the temperature and humidity available via MQTT discovery, so they're automatically added to Home Assistant, because that way it's typesafe.
48+
* Possible values: Enabled/Disabled
49+
* Default: Disabled
50+
51+
## Change log
52+
2022-12
53+
* First implementation.
54+
55+
## Credits
56+
ezcGman | Andy: Find me on the Intermit.Tech (QuinLED) Discord server: https://discord.gg/WdbAauG

0 commit comments

Comments
 (0)