Merge remote-tracking branch 'Tasmota/development' into development

This commit is contained in:
Jason2866 2020-05-19 17:47:27 +02:00
commit d9a10660c5
22 changed files with 746 additions and 127 deletions

View File

@ -52,10 +52,7 @@ The following binary downloads have been compiled with ESP8266/Arduino library c
## Changelog
### Version 8.3.0.2
### Version 8.3.1.1
- Change KNX pow function to approximative pow saving 5k of code space
- Change Mutichannel Gas sensor pow function to approximative pow saving 5k of code space
- Change Quick Power Cycle detection from 4 to 7 power interrupts (#4066)
- Fix default state of ``SetOption73 0`` for button decoupling and send multi-press and hold MQTT messages
- Add command ``DeviceName`` defaults to FriendlyName1 and replaces FriendlyName1 in GUI
- Add command ``Rule0`` to change global rule parameters
- Add more functionality to ``Switchmode`` 11 and 12 (#8450)

View File

@ -56,6 +56,7 @@ ledscom.de 4.5W 430lm {"NAME":"GX53","GPIO":[0,0,0,0,0,0,0,0,38,0,37,0,0],"FL
Lohas ZN070 720lm {"NAME":"Lohas ZN070","GPIO":[0,0,0,0,0,0,0,0,38,0,37,0,0],"FLAG":0,"BASE":18}
Lumiman A19 7.5W 800lm {"NAME":"Lumiman LM520","GPIO":[0,0,0,0,0,37,0,0,38,0,0,0,0],"FLAG":0,"BASE":18}
Luminea ZX-2831 {"NAME":"Luminea CCT","GPIO":[0,0,0,0,140,37,0,0,38,142,141,0,0],"FLAG":0,"BASE":18}
LVWIT A60 6.5W 806lm Filament {"NAME":"LVWIT-E27-WiFi-6.5","GPIO":[0,0,0,0,0,0,0,0,38,0,37,0,0],"FLAG":0,"BASE":18}
Merkury MI-BW905-999W 700lm {"NAME":"MI-BW905-999W","GPIO":[0,0,0,0,0,37,0,0,38,0,0,0,0],"FLAG":0,"BASE":18}
Mimoodz 1050lm {"NAME":"ID Components","GPIO":[0,0,0,0,21,22,0,0,23,24,25,26,27],"FLAG":0,"BASE":18}
Mirabella Genio 9W 800lm {"NAME":"GenioBulbCCT","GPIO":[0,0,0,0,0,37,0,0,0,38,0,0,0],"FLAG":0,"BASE":18}
@ -156,6 +157,7 @@ Nedis G125 Filament {"NAME":"WIFILF10GDG125","GPIO":[0,0,0,0,0,0,0,0,0,0,37
Nedis PAR16 330lm {"NAME":"Nedis WIFILW31","GPIO":[0,0,0,0,0,37,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
Sealight Vintage Edison A19 {"NAME":"SealightEdison","GPIO":[0,0,0,0,0,37,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
TCP Smart 810lm Filament {"NAME":"TCP Filament","GPIO":[0,0,0,0,0,0,0,0,0,0,46,0,0],"FLAG":0,"BASE":18}
Xiaomi Philips MUE4088RT {"NAME":"Xiaomi Philips","GPIO":[0,0,0,0,0,0,0,0,0,0,0,37,0],"FLAG":0,"BASE":18}
```
## Dimmer
@ -171,6 +173,7 @@ Eva Logik WF31 {"NAME":"WF31 Dimmer","GPIO":[255,107,255,108,255,255,0
EX-Store 2 Kanal RS232 V4 {"NAME":"EXS Dimmer","GPIO":[0,148,0,149,0,0,0,0,0,183,0,0,0],"FLAG":0,"BASE":72}
Feit Electric DIM/WIFI {"NAME":"Generic","GPIO":[255,107,255,108,255,255,0,0,255,0,255,0,255],"FLAG":0,"BASE":54}
Gosund SW2 {"NAME":"Gosund Dimmer","GPIO":[255,148,255,149,17,0,255,255,56,158,37,255,255],"FLAG":0,"BASE":18}
iSwitch Touch Switch {"NAME":"iSwitchOZ Dimmer","GPIO":[0,0,0,0,0,0,0,0,0,0,54,0,0],"FLAG":0,"BASE":54}
Martin Jerry MJ-SD01 {"NAME":"MJ-SD02","GPIO":[19,18,0,59,158,58,0,0,57,37,56,122,29],"FLAG":0,"BASE":73}
Moes DS01-1 {"NAME":"MOES DS01","GPIO":[255,255,255,255,255,255,0,0,255,108,255,107,255],"FLAG":0,"BASE":54}
Moes MS-105-1 v2 {"NAME":"MS-105","GPIO":[0,107,0,108,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":54}
@ -235,6 +238,7 @@ Arilux SL-LC 09 {"NAME":"Arilux LC09","GPIO":[0,0,0,0,106,37,0,0,39,0,3
DD001-MINI(G)-IR-V08 {"NAME":"WIFI-RGB","GPIO":[0,0,0,0,37,0,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
Electrodragon ESP LED Strip Board, Mosfet Drive {"NAME":"LEDBoard RGBW","GPIO":[0,0,0,0,0,0,0,0,39,38,40,37,52],"FLAG":0,"BASE":18}
H801 {"NAME":"H801","GPIO":[0,52,0,0,41,57,0,0,39,38,40,37,0],"FLAG":0,"BASE":20}
Jinvoo SM-WA104 RGB {"NAME":"Jinvoo LED Controller","GPIO":[0,0,0,0,29,39,0,0,37,17,38,0,30],"FLAG":0,"BASE":18}
LEDEnet {"NAME":"LEDEnet","GPIO":[0,255,56,255,147,41,0,0,38,39,37,40,0],"FLAG":0,"BASE":34}
Luminea ZX-2844 {"NAME":"Luminea ZX-284","GPIO":[40,0,0,0,0,39,0,0,38,17,37,0,0],"FLAG":0,"BASE":18}
Luminea ZX-2844-675 {"NAME":"ZX-2844-675","GPIO":[17,0,0,0,38,40,0,0,37,0,39,0,0],"FLAG":0,"BASE":18}
@ -263,6 +267,7 @@ Briloner 2256-150 RGB {"NAME":"Briloner2256-1","GPIO":[51,0,0,0,37,0,0,0,38,0
Cocoon Smart {"NAME":"Cocoon Smart","GPIO":[17,0,0,0,37,0,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
HitLights L1012V-MC1 {"NAME":"HitLights RBG","GPIO":[17,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
Hykker 3m RGB {"NAME":"HYKKER Strip","GPIO":[0,0,0,0,0,37,0,0,39,17,38,0,0],"FLAG":0,"BASE":18}
INDARUN RGB String Lights {"NAME":"STAR301","GPIO":[0,0,0,0,51,37,0,0,38,39,0,0,0],"FLAG":0,"BASE":34}
LE LampUX 16.4ft RGB {"NAME":"LampUX","GPIO":[0,18,17,0,0,38,0,0,39,51,0,37,0],"FLAG":0,"BASE":18}
LE LampUX 2m RGB TV Backlight {"NAME":"LE 904102","GPIO":[0,17,18,0,0,38,0,0,39,19,0,37,0],"FLAG":0,"BASE":18}
LE LampUX 5m RGB {"NAME":"LampUX","GPIO":[17,0,0,0,0,38,0,0,39,0,0,37,0],"FLAG":0,"BASE":18}
@ -287,6 +292,7 @@ Arlec Smart 15W Security Floodlight {"NAME":"ArlecFlood","GPIO":[0,0,0,0,0,0,0,
Arlec Smart 40W 4000lm LED Batten {"NAME":"Arlec Batten","GPIO":[0,0,0,0,0,37,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
Arlec Smart Portable Floodlight 10.5W {"NAME":"Arlec GLD301HA","GPIO":[0,0,0,0,0,37,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
BlitzWolf BW-LT20 {"NAME":"BW-LT20","GPIO":[0,0,0,0,0,37,0,0,0,38,0,0,0],"FLAG":15,"BASE":18}
Brilex Nightstand Lamp {"NAME":"Smart Table La","GPIO":[0,0,18,0,37,157,0,0,38,17,39,0,40],"FLAG":0,"BASE":18}
Brilliant CORDIA Colour Temperature Changing LED Flush Ceiling Light {"NAME":"Brilliant Oyst","GPIO":[0,0,0,0,0,37,0,0,38,0,0,0,0],"FLAG":0,"BASE":18}
BrilliantSmart 20695 Downlight CCT {"NAME":"SmartCCTDwnLgt","GPIO":[0,0,0,0,0,37,0,0,0,38,0,0,0],"FLAG":0,"BASE":48}
BrilliantSmart Prism LED RGBCCT Downlight {"NAME":"Prism","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
@ -299,6 +305,7 @@ Deta DET902HA 10W 940lm RGB+CCT {"NAME":"Deta DownLight","GPIO":[0,0,0,0,38,37,
electriQ MOODL Ambiance Lamp {"NAME":"ElectriQ MOODL","GPIO":[0,201,0,0,0,0,0,0,0,0,0,0,0],"FLAG":0,"BASE":18}
Fcmila 48W RGBCCT Ceiling Lamp {"NAME":"XDD-48W","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
Feit Electric 6in. RGBW Recessed Downlight {"NAME":"Feit LEDR6/RGB","GPIO":[0,0,0,0,37,40,0,0,38,50,39,0,0],"FLAG":0,"BASE":48}
Globe 5W 4" Recessed RGBCCT {"NAME":"GlobeRGBWW","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
Hyperikon 14W 1000lm 6" Downlight {"NAME":"HyperikonDL6","GPIO":[0,0,0,0,38,37,0,0,41,39,40,0,0],"FLAG":0,"BASE":18}
iHomma 6W RGBCCT Downlight {"NAME":"iHomma RGBWW","GPIO":[0,0,0,0,41,40,0,0,37,38,39,0,0],"FLAG":0,"BASE":18}
iHomma Downlight {"NAME":"iHommaLEDDownl","GPIO":[0,0,0,0,0,40,0,0,37,38,39,0,0],"FLAG":0,"BASE":18}
@ -307,6 +314,7 @@ LE lampUX 15W RGBCCT Ceiling {"NAME":"LE lampUX 15W","GPIO":[0,0,0,0,37,40,0,0,
Lohas ZN026CL10 RGBCCT {"NAME":"Lohas LED Lamp","GPIO":[0,0,0,0,38,37,0,0,40,39,41,0,0],"FLAG":0,"BASE":18}
Lumary 18W RGBCCT Recessed Panel {"NAME":"LumaryDLghtRGB","GPIO":[0,0,0,0,38,37,0,0,41,39,40,0,0],"FLAG":0,"BASE":18}
Mi LED Desk Lamp MJTD01YL {"NAME":"Mi Desk Lamp","GPIO":[0,0,17,0,37,38,0,0,150,151,0,0,0],"FLAG":0,"BASE":66}
MiraBella Genio 6 Pack 30mm Stainless Steel Deck Kit {"NAME":"Genio RGB Deck Lights","GPIO":[0,0,0,0,37,0,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
Mirabella Genio I002741 {"NAME":"GenioDLightRGB","GPIO":[0,0,0,0,38,37,0,0,41,39,40,0,0],"FLAG":0,"BASE":18}
Mirabella Genio I002742 {"NAME":"GenioDLightCCT","GPIO":[0,0,0,0,0,0,0,0,38,0,37,0,0],"FLAG":0,"BASE":48}
Mirabella Genio I002798 Warm White Filament Festoon {"NAME":"GenioFestoon","GPIO":[0,0,0,0,0,0,0,0,0,0,37,0,0],"FLAG":0,"BASE":18}
@ -492,7 +500,7 @@ DILISENS SP201 {"NAME":"Dilisens SP201","GPIO":[0,0,131,0,133,132,52,2
Dunnes Stores {"NAME":"SmartLifePlug","GPIO":[0,0,0,17,0,0,0,0,0,56,21,0,0],"FLAG":0,"BASE":18}
DWFeng AWP02L-N {"NAME":"AWP02L-N","GPIO":[255,255,56,255,255,255,0,0,255,17,255,21,255],"FLAG":0,"BASE":18}
DWFeng BSD01 {"NAME":"DWFeng BSD01","GPIO":[255,255,255,255,255,255,255,255,21,17,56,255,255],"FLAG":15,"BASE":18}
ECO Plugs CT-065W {"NAME":"ECO/CT-065W","GPIO":[255,255,255,255,255,255,0,0,255,17,255,21,255],"FLAG":0,"BASE":18}
ECO Plugs CT-065W {"NAME":"ECO/CT-065W","GPIO":[0,0,0,0,0,0,0,0,0,17,0,21,0],"FLAG":0,"BASE":18}
eco4life DPS1101S {"NAME":"Eco4Life Plug","GPIO":[0,0,0,0,52,57,0,0,21,17,0,0,0],"FLAG":0,"BASE":18}
ednet 84334 {"NAME":"84334","GPIO":[0,0,0,0,56,57,0,0,21,17,0,0,0],"FLAG":0,"BASE":18}
eFamilyCloud ASDFEE174 {"NAME":"eFamily Plug","GPIO":[0,0,0,0,52,21,0,0,0,17,0,0,0],"FLAG":0,"BASE":18}
@ -515,6 +523,7 @@ Foval SM-PW701E {"NAME":"SM-PW701E","GPIO":[0,0,0,0,56,0,0,0,21,17,0,0,
FrankEver FLHS-ZN04 {"NAME":"Israel plug","GPIO":[57,0,56,131,0,134,0,0,0,17,132,21,0],"FLAG":0,"BASE":45}
GDTech W-US001 {"NAME":"GDTech W-US001","GPIO":[255,17,255,255,255,255,0,0,255,56,21,255,255],"FLAG":1,"BASE":18}
GDTech W-US003 {"NAME":"W-US003","GPIO":[0,17,255,255,255,0,0,0,0,56,21,0,0],"FLAG":0,"BASE":18}
Geekbes YM-WS-1 {"NAME":"Office Test Pl","GPIO":[255,255,255,255,255,255,255,255,158,17,12,21,255],"FLAG":15,"BASE":18}
Geeni Spot {"NAME":"Geeni Spot","GPIO":[0,0,0,0,52,57,0,0,21,17,0,0,0],"FLAG":0,"BASE":18}
Geeni Spot Glo {"NAME":"Geeni Glo","GPIO":[0,0,0,0,56,0,0,0,21,17,22,0,0],"FLAG":0,"BASE":18}
Geeni Switch {"NAME":"Geeni Switch","GPIO":[0,0,0,0,52,57,0,0,21,17,0,0,0],"FLAG":0,"BASE":18}
@ -538,7 +547,7 @@ Gosund WP5 {"NAME":"Gosund-WP5","GPIO":[255,255,255,255,17,255,0,0
Gosund WP6 {"NAME":"Gosund WP6","GPIO":[0,0,0,17,0,0,0,0,56,57,21,0,0],"FLAG":0,"BASE":18}
Grefic TE101 {"NAME":"Grefic TE101","GPIO":[0,0,0,0,56,0,0,0,21,17,0,0,0],"FLAG":0,"BASE":1}
Gyman SM-PW701U {"NAME":"Gyman","GPIO":[255,255,157,255,56,255,0,0,21,17,255,255,255],"FLAG":0,"BASE":18}
Hama 16 A {"NAME":"Hama Plug","GPIO":[0,0,0,17,134,132,0,0,131,56,21,0,0],"FLAG":0,"BASE":52}
Hama 16A 3680W {"NAME":"Hama Plug","GPIO":[0,0,0,17,134,132,0,0,131,56,21,0,0],"FLAG":0,"BASE":52}
Hauppauge 01647 {"NAME":"SL-1642","GPIO":[0,0,0,0,52,0,0,0,21,17,0,0,0],"FLAG":0,"BASE":18}
HiHome WPP-10S1 {"NAME":"HIhome WPP-10S","GPIO":[56,0,158,255,0,134,0,0,131,17,132,21,0],"FLAG":0,"BASE":49}
HiHome WPP-10S2 {"NAME":"HiHome WPP-10S","GPIO":[17,0,0,0,134,132,0,0,131,56,21,0,0],"FLAG":0,"BASE":49}
@ -695,6 +704,7 @@ Teckin SP25 {"NAME":"Teckin SP25","GPIO":[56,255,255,255,255,255,0,
Teckin SP27 {"NAME":"Teckin SP27","GPIO":[56,255,255,255,255,255,0,0,255,17,255,21,255],"FLAG":0,"BASE":18}
Tflag NX-SM100 {"NAME":"NX-SM100","GPIO":[56,0,0,0,0,134,0,0,21,17,132,57,131],"FLAG":0,"BASE":18}
TikLok TL650 {"NAME":"TikLok Mini","GPIO":[0,0,0,0,57,0,0,0,21,17,0,0,0],"FLAG":0,"BASE":18}
Timethinker C338 {"NAME":"C338","GPIO":[17,0,255,0,0,0,0,0,21,52,255,0,0],"FLAG":0,"BASE":1}
Timethinker TK04 {"NAME":"TimethinkerEU","GPIO":[255,255,255,255,17,255,0,0,255,52,21,255,0],"FLAG":0,"BASE":18}
TimeThinker WS2 {"NAME":"TimeThinkerWS2","GPIO":[0,0,0,0,17,0,0,0,0,52,21,0,0],"FLAG":0,"BASE":18}
TomaxUSA HKWL-SO07W {"NAME":"HKWL-SO07W","GPIO":[17,255,255,255,255,255,0,0,255,255,21,255,56],"FLAG":0,"BASE":18}
@ -756,14 +766,14 @@ ZSP-001 {"NAME":"ZSP-001","GPIO":[17,255,255,255,133,132,0,0,13
## Power Strip
```
A0F0 ZLD-44EU-W {"NAME":"AOFO-4AC-4USB","GPIO":[0,56,0,17,22,21,0,0,23,24,25,0,0],"FLAG":1,"BASE":18}
A0F0 ZLD-44EU-W {"NAME":"AOFO-4AC-4USB","GPIO":[0,56,0,17,22,21,0,0,23,24,33,0,0],"FLAG":1,"BASE":18}
Acenx 3AC+3USB {"NAME":"ACENX 3-Outlet","GPIO":[56,55,54,53,0,21,0,0,23,24,22,0,17],"FLAG":0,"BASE":18}
Annhome 3AC + 2USB {"NAME":"1200W WiFi SPS","GPIO":[32,0,0,0,57,52,0,0,21,17,22,23,33],"FLAG":0,"BASE":18}
AOFO 3AC+4USB {"NAME":"AOFO","GPIO":[0,56,0,17,22,21,0,0,0,23,24,0,0],"FLAG":1,"BASE":18}
AOFO 4AC+4USB {"NAME":"AOFO4AC4USB","GPIO":[0,56,0,17,22,21,0,0,23,24,25,0,0],"FLAG":0,"BASE":18}
AOFO 4AC+4USB Tuya {"NAME":"AOFO-4AC-4USB","GPIO":[255,255,255,255,255,255,0,0,255,255,255,255,255],"FLAG":1,"BASE":54}
AOFO 4AC+4USB UK {"NAME":"AOFO4AC4USB-UK","GPIO":[0,56,0,17,23,24,0,0,22,21,33,0,0],"FLAG":0,"BASE":18}
Arlec Smart 3 Outlet Power Cube {"NAME":"Arlec Cube","GPIO":[0,17,0,0,0,0,0,0,0,52,21,0,0],"FLAG":0,"BASE":18}
Arlec Smart 3 Outlet Power Cube {"NAME":"Arlec Cube","GPIO":[0,17,0,0,0,0,0,0,0,56,21,0,0],"FLAG":0,"BASE":18}
Arlec Smart PB88UHA {"NAME":"Arlec PB88UHA","GPIO":[0,56,0,17,22,21,0,0,24,23,0,0,0],"FLAG":15,"BASE":18}
Arlec Smart PB89HA {"NAME":"Arlec PB89HA","GPIO":[0,56,0,17,22,21,0,0,24,23,0,0,0],"FLAG":0,"BASE":18}
Bauhn ASPBU-1019 {"NAME":"Bauhn 3AC+3USB","GPIO":[0,157,0,0,22,21,0,0,0,23,17,0,0],"FLAG":0,"BASE":18}
@ -865,6 +875,7 @@ BNeta IO-WIFI60-E27P 800lm {"NAME":"OM60/RGBW","GPIO":[0,0,0,0,140,37,0,0,38,14
Bomcosy 600lm {"NAME":"Generic","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":1,"BASE":18}
Calex 429002 Reflector 350lm {"NAME":"Calex RGBW","GPIO":[0,0,0,0,0,0,0,0,181,0,180,0,0],"FLAG":0,"BASE":18}
Calex 429004 A60 806lm {"NAME":"Calex E27 RGB ","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
Calex 429008 B35 5W 470lm {"NAME":"Calex E14 RGBW","GPIO":[0,0,0,0,0,0,0,0,181,0,180,0,0],"FLAG":0,"BASE":18}
Cleverio 51395 806lm {"NAME":"CleverioE27RGB","GPIO":[0,0,0,0,140,37,0,0,38,142,141,0,0],"FLAG":0,"BASE":18}
CMARS 4W Reflector {"NAME":"RGBWW GU10","GPIO":[0,0,0,0,40,41,0,0,38,39,37,0,0],"FLAG":15,"BASE":18}
Dogain 320lm {"NAME":"DOGAIN","GPIO":[0,0,0,0,40,41,0,0,38,39,37,0,0],"FLAG":0,"BASE":18}
@ -889,6 +900,7 @@ Kogan 10W 1050lm {"NAME":"Kogan RGB+CCT","GPIO":[255,255,255,0,37,40,255
Kohree 600lm {"NAME":"Kohree VHP560","GPIO":[0,0,0,0,37,41,0,0,38,40,39,0,0],"FLAG":0,"BASE":18}
LE lampUX 8.5W 806lm {"NAME":"lampUX","GPIO":[0,0,0,0,141,140,0,0,38,142,37,0,0],"FLAG":15,"BASE":18}
LE lampUX A19 850lm {"NAME":"LE RGBWW 60W","GPIO":[0,0,0,0,140,37,0,0,38,142,141,0,0],"FLAG":1,"BASE":18}
LE lampUX A19 9W 806lm {"NAME":"lampUX","GPIO":[0,0,0,0,141,140,0,0,38,142,37,0,0],"FLAG":15,"BASE":18}
Ledmundo 6W 600lm {"NAME":"LEDMUNDO 6W","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
Legelite 5W Candle {"NAME":"Legelite E12","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
Legelite A60 7W {"NAME":"Legelite A60 7","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":18}
@ -949,7 +961,7 @@ AWOW A60 9W 800lm {"NAME":"AWOW 9W RGBW","GPIO":[0,0,0,0,37,40,0,0,38,0,3
Axtee AI-003 A19 700lm {"NAME":"Axtee E26 7W","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":20}
Bawoo EUWL122130 925lm {"NAME":"Bawoo","GPIO":[0,0,0,0,140,37,0,0,0,142,141,0,0],"FLAG":0,"BASE":18}
BlitzWolf BW-LT21 900lm {"NAME":"BlitzWolf LT21","GPIO":[0,0,0,0,41,39,0,0,38,0,37,40,0],"FLAG":0,"BASE":18}
BNeta IO-WIFI-GU10 380lm {"NAME":"BNeta","GPIO":[0,0,0,0,140,37,0,0,38,142,141,0,0],"FLAG":0,"BASE":18}
BNeta IO-WIFI-GU10 380lm {"NAME":"BNeta","GPIO":[0,0,0,0,141,140,0,0,37,142,0,0,0],"FLAG":0,"BASE":18}
BriHome 6,5W 500lm {"NAME":"BRI E27 6,5W","GPIO":[0,0,0,0,37,40,0,0,38,41,39,0,0],"FLAG":0,"BASE":20}
Brilliant HK17653S72 350lm {"NAME":"HK17653S72","GPIO":[0,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
BrilliantSmart 20698 9W 800lm {"NAME":"Brilliant20698","GPIO":[0,0,0,0,141,140,0,0,37,142,0,0,0],"FLAG":0,"BASE":18}
@ -961,7 +973,6 @@ BrizLabs Candle 4,5W 350lm {"NAME":"BrizLabs RGBW","GPIO":[0,0,0,0,37,40,0,0,38
Brizlabs EBE-LZW10 350Lm {"NAME":"Brizlabs E14","GPIO":[0,0,0,0,141,140,0,0,37,142,0,0,0],"FLAG":15,"BASE":18}
BrizLabs EBE-SHW03 380lm {"NAME":"BrizLabs","GPIO":[0,0,0,0,140,37,0,0,0,142,141,0,0],"FLAG":0,"BASE":18}
BTZ1 {"NAME":"WifiBulb","GPIO":[0,0,0,0,0,37,0,0,39,40,38,0,0],"FLAG":0,"BASE":18}
Calex 429008 B35 5W 470lm {"NAME":"Calex E14 RGBW","GPIO":[0,0,0,0,0,0,0,0,181,0,180,0,0],"FLAG":0,"BASE":18}
Cleverio 51398 370lm {"NAME":"CleverioGU10","GPIO":[0,0,0,0,140,37,0,0,38,142,141,0,0],"FLAG":0,"BASE":18}
Cocoon DY180363-B 800lm {"NAME":"Cocoon RGBW","GPIO":[0,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
Connex Connect A60 6W 470lm {"NAME":"Connex RGBW Bu","GPIO":[0,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
@ -982,6 +993,7 @@ Gosund WB3 8W 800lm {"NAME":"Gosund WB3","GPIO":[0,0,0,0,40,0,0,0,37,38,39,
Hama 10W 1050lm {"NAME":"Hama Bulb RGBW","GPIO":[0,0,0,0,140,37,0,0,0,142,141,0,0],"FLAG":0,"BASE":18}
Hama 10W 806lm {"NAME":"Hama Smart WiF","GPIO":[0,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
Hama 4.5W {"NAME":"hama E14 RGB","GPIO":[0,0,0,0,37,40,0,0,38,0,39,0,0],"FLAG":0,"BASE":18}
Hiiten A19 7W 650lm {"NAME":"Hiiten Bulb","GPIO":[37,0,0,0,140,38,0,0,0,142,141,0,0],"FLAG":0,"BASE":18}
Hykker SL-0492 810lm {"NAME":"Hykker RBGW 9W","GPIO":[0,0,0,0,0,40,0,0,37,0,39,38,0],"FLAG":0,"BASE":18}
Kainsy 600lm {"NAME":"KAINSY","GPIO":[17,0,0,0,143,144,0,0,0,0,0,0,0],"FLAG":0,"BASE":27}
Koaanw 650lm {"NAME":"KOAANW Bulb","GPIO":[0,0,0,0,143,144,0,0,0,0,0,0,0],"FLAG":0,"BASE":27}
@ -1068,6 +1080,7 @@ Zilotek A19 800lm {"NAME":"Zilotek RGBW","GPIO":[0,0,0,0,140,37,0,0,38,14
```
1 Channel Inching/Self-Locking {"NAME":"1 Channel","GPIO":[17,0,0,0,0,0,0,0,21,56,0,0,0],"FLAG":0,"BASE":12}
BlitzWolf BW-SS1 {"NAME":"BW-SS1","GPIO":[255,255,255,255,157,21,0,0,255,17,255,255,0],"FLAG":0,"BASE":18}
BlitzWolf BW-SS5 2 Gang {"NAME":"BlitzWolf SS5 2 Gang","GPIO":[0,0,0,0,160,0,0,0,43,42,21,22,0],"FLAG":0,"BASE":18}
BlitzWolf SS4 Two Gang {"NAME":"BlitzWolf SS4","GPIO":[0,0,0,0,56,21,0,0,22,17,0,0,0],"FLAG":0,"BASE":18}
Canwing CW-001 {"NAME":"Canwing CW-001","GPIO":[17,255,0,255,0,0,0,0,21,56,0,0,0],"FLAG":0,"BASE":1}
Century Aoke Smart Switch {"NAME":"CenturyAoke","GPIO":[0,255,0,255,21,0,0,0,17,56,255,0,0],"FLAG":0,"BASE":18}
@ -1163,6 +1176,8 @@ BlitzWolf BW-SS3 2 Gang {"NAME":"BW-SS3-2G-EU","GPIO":[157,255,255,255,22,18,25
BlitzWolf BW-SS3 3 Gang {"NAME":"BlitzWolf SS3","GPIO":[158,0,0,10,22,11,0,0,9,21,0,23,0],"FLAG":0,"BASE":18}
CD303 3 Gang Touch {"NAME":"Touch Switch 3","GPIO":[54,57,255,19,23,18,255,255,17,21,255,22,52],"FLAG":15,"BASE":18}
Connect Smart 2 Gang Wall {"NAME":"CSH-SWTCH2","GPIO":[0,0,52,0,0,18,0,0,22,21,0,0,17],"FLAG":0,"BASE":18}
Deta 3 Gang {"NAME":"DETA 3G Switch","GPIO":[157,0,0,92,91,21,0,0,23,0,22,0,90],"FLAG":0,"BASE":18}
Deta 4 Gang {"NAME":"Deta 4G Switch","GPIO":[157,0,0,17,18,24,0,0,21,19,22,23,20],"FLAG":0,"BASE":18}
Deta 6911HA {"NAME":"Deta 1G Switch","GPIO":[0,0,0,0,157,0,0,0,0,21,0,0,90],"FLAG":0,"BASE":18}
Deta 6912HA {"NAME":"DETA 2G Switch","GPIO":[0,0,0,0,157,0,0,0,91,21,22,0,90],"FLAG":0,"BASE":18}
Digoo DG-S811 3 Gang {"NAME":"DIGOO Switch","GPIO":[0,0,0,0,19,18,0,0,22,21,23,0,17],"FLAG":0,"BASE":18}
@ -1175,6 +1190,7 @@ Enjowi WF-SK301 {"NAME":"Tuya 3 Channel","GPIO":[0,0,0,0,23,18,0,0,17,2
Etekcity ESWL01 {"NAME":"EtekCityESWL01","GPIO":[0,255,0,255,52,53,0,0,0,21,122,0,0],"FLAG":1,"BASE":18}
Etekcity ESWL03 3-way {"NAME":"Etekcity 3Way","GPIO":[0,0,0,0,23,29,0,0,82,22,10,0,0],"FLAG":0,"BASE":18}
Eva Logik WF30 3-Way {"NAME":"WF30 Switch","GPIO":[0,0,0,0,18,0,0,0,21,17,0,0,0],"FLAG":0,"BASE":18}
Freecube AWS01F {"NAME":"Freecube","GPIO":[0,0,0,17,21,0,0,0,0,0,22,0,0],"FLAG":0,"BASE":18}
Geeni TAP 3-Way {"NAME":"Geeni 3-Way","GPIO":[157,0,0,0,0,0,0,0,17,21,0,0,0],"FLAG":0,"BASE":18}
Girier EK01 RF433Mhz 1 Gang {"NAME":"Girier EK01","GPIO":[157,0,0,0,21,0,0,0,0,0,0,0,17],"FLAG":0,"BASE":18}
Girier EK02 RF433Mhz 2 Gang {"NAME":"Girier EK02","GPIO":[157,0,0,0,0,17,0,0,18,21,22,0,0],"FLAG":0,"BASE":18}
@ -1207,6 +1223,7 @@ LerLink X801A-L No Neutral {"NAME":"LerLink X801-L","GPIO":[0,0,0,0,17,0,0,0,21
Lerlink X802A 2 Gang {"NAME":"Lerlink X802A","GPIO":[0,0,0,18,17,0,0,0,21,23,22,0,0],"FLAG":15,"BASE":18}
LerLink X802A-L No Neutral {"NAME":"LerLink X802-L","GPIO":[0,0,0,18,17,0,0,0,21,158,22,0,0],"FLAG":15,"BASE":18}
Lightstory WT02S {"NAME":"WT02S","GPIO":[0,0,0,0,57,56,0,0,21,17,0,0,0],"FLAG":0,"BASE":50}
Lonsonho 3 Gang {"NAME":"Lonsonho X803A","GPIO":[0,0,0,18,17,19,0,0,21,29,22,23,0],"FLAG":0,"BASE":18}
Lonsonho SK3-01 {"NAME":"Tuya 1 Channel","GPIO":[0,0,0,0,0,17,0,0,0,0,0,21,52],"FLAG":0,"BASE":18}
Lonsonho SK3-02 {"NAME":"Tuya 2 Channel","GPIO":[0,0,0,0,22,0,0,0,17,21,18,0,52],"FLAG":0,"BASE":18}
Lonsonho SK3-03 {"NAME":"Tuya 3-ch v2","GPIO":[157,58,0,18,22,19,0,0,17,21,57,23,56],"FLAG":0,"BASE":18}
@ -1269,6 +1286,7 @@ Sonoff T1 US 3 Gang {"NAME":"Sonoff T1 3CH","GPIO":[17,255,255,255,23,22,18
Sonoff Touch {"NAME":"Sonoff Touch","GPIO":[17,255,0,255,0,0,0,0,21,56,0,0,0],"FLAG":0,"BASE":10}
Sonoff Touch {"NAME":"Sonoff Touch","GPIO":[17,255,0,255,0,0,0,0,21,56,0,0,0],"FLAG":0,"BASE":10}
Sonoff TX T3 3 Gang {"NAME":"TX T3EU3C","GPIO":[17,255,0,255,23,22,18,19,21,158,0,0,0],"FLAG":0,"BASE":30}
SPC Hera {"NAME":"SPC HERA","GPIO":[157,0,0,17,21,0,0,0,0,0,52,0,0],"FLAG":0,"BASE":18}
SRL 3-4WW 4 Gang {"NAME":"SRL 4WW Switch","GPIO":[0,0,0,19,23,18,0,0,17,21,24,22,20],"FLAG":0,"BASE":18}
SS118-01K1 {"NAME":"SS118-01K1","GPIO":[255,255,255,17,21,255,0,0,255,255,56,255,255],"FLAG":0,"BASE":18}
SS86-AI 3-Gang {"NAME":"SS86-AI 3 Gang","GPIO":[157,0,58,18,22,19,0,0,17,21,57,23,56],"FLAG":0,"BASE":18}

View File

@ -66,13 +66,14 @@ RA8876::RA8876(int8_t cs,int8_t mosi,int8_t miso,int8_t sclk,int8_t bp) : Render
//#define RA8876_CS_LOW digitalWrite(m_csPin, LOW)
//#define RA8876_CS_HIGH digitalWrite(m_csPin, HIGH)
#ifdef ESP8266
#ifndef ESP32
#define RA8876_CS_LOW GPOC=(1<<m_csPin);
#define RA8876_CS_HIGH GPOS=(1<<m_csPin);
#else
#define RA8876_CS_LOW digitalWrite(1<<m_csPin,0);
#define RA8876_CS_HIGH digitalWrite(1<<m_csPin,1);
#define RA8876_CS_LOW digitalWrite(m_csPin,0);
#define RA8876_CS_HIGH digitalWrite(m_csPin,1);
#endif
/*
extern void ICACHE_RAM_ATTR RA8876_digitalWrite(uint8_t pin, uint8_t val) {
//stopWaveform(pin);
@ -173,10 +174,8 @@ void RA8876::DisplayOnff(int8_t on) {
uint8_t dpcr;
SPI.beginTransaction(m_spiSettings);
dpcr = readReg(RA8876_REG_DPCR);
if (on) {
dpcr |= 0x40; // Display on
dim(dimmer);
} else {
dpcr &= 0x40^0xff; // Display off
// backlight off
@ -185,12 +184,14 @@ void RA8876::DisplayOnff(int8_t on) {
}
writeReg(RA8876_REG_DPCR, dpcr);
SPI.endTransaction();
if (on) {
dim(dimmer);
}
}
// 0-15
void RA8876::dim(uint8_t contrast) {
SPI.beginTransaction(m_spiSettings);
dimmer=contrast;
// pwm0 duty
uint32_t duty=(contrast*1024)/15;
@ -671,10 +672,18 @@ bool RA8876::begin(void) {
return false;
}
#ifndef ESP32
SPI.begin();
#else
SPI.begin(_sclk,_miso,_mosi , -1);
#endif
m_spiSettings = SPISettings(RA8876_SPI_SPEED, MSBFIRST, SPI_MODE3);
#ifdef RA8876_DEBUG
Serial.printf("RA8876 init\n");
#endif
softReset();
if (!initPLL()) {
@ -682,24 +691,44 @@ bool RA8876::begin(void) {
return false;
}
#ifdef RA8876_DEBUG
Serial.printf("RA8876 init pll OK\n");
#endif
if (!initMemory(m_sdramInfo)) {
//Serial.println("initMemory failed");
return false;
}
#ifdef RA8876_DEBUG
Serial.printf("RA8876 init sdram OK\n");
#endif
if (!initDisplay()) {
//Serial.println("initDisplay failed");
return false;
}
#ifdef RA8876_DEBUG
Serial.printf("RA8876 init display OK\n");
#endif
// Set default font
selectInternalFont(RA8876_FONT_SIZE_16);
setTextScale(1);
#ifdef RA8876_DEBUG
Serial.printf("RA8876 set scale OK\n");
#endif
setRotation(0);
clearScreen(0);
#ifdef RA8876_DEBUG
Serial.printf("RA8876 init complete\n");
#endif
return true;
}
@ -899,7 +928,8 @@ void RA8876::setAddrWindow(uint16_t x0, uint16_t y0, uint16_t x1, uint16_t y1) {
writeCmd(RA8876_REG_MRWDP); //04h();
if (flag) SPI.endTransaction();
//if (flag) SPI.endTransaction();
SPI.endTransaction();
}
void RA8876::pushColors(uint16_t *data, uint8_t len, boolean first) {
@ -980,7 +1010,9 @@ void RA8876::waitWriteFifo(void) {
// timeout, soft reset
softReset();
SPI.beginTransaction(m_spiSettings);
#ifdef RA8876_DEBUG
Serial.printf("iter timeout fifo\n");
#endif
return;
}
}
@ -1001,7 +1033,9 @@ void RA8876::wait_ready(void) {
// timeout, soft reset
softReset();
SPI.beginTransaction(m_spiSettings);
#ifdef RA8876_DEBUG
Serial.printf("iter timeout cmd\n");
#endif
return;
}
}
@ -1188,11 +1222,13 @@ void RA8876::setTextMode(void) {
uint8_t icr = readReg(RA8876_REG_ICR);
writeReg(RA8876_REG_ICR, icr | 0x04);
SPI.endTransaction();
if (textcolor==textbgcolor) {
setDrawMode_reg(1);
} else {
setDrawMode_reg(0);
}
SPI.beginTransaction(m_spiSettings);
}
@ -1368,7 +1404,9 @@ size_t RA8876::xwrite(const uint8_t *buffer, size_t size) {
; // Ignored
else if (c == '\n')
{
SPI.endTransaction();
setCursor(0, getCursorY() + getTextSizeY());
SPI.beginTransaction(m_spiSettings);
writeCmd(RA8876_REG_MRWDP); // Reset current register for writing to memory
}
else if ((m_fontFlags & RA8876_FONT_FLAG_XLAT_FULLWIDTH) && ((c >= 0x21) || (c <= 0x7F)))

View File

@ -23,6 +23,7 @@
#include <SPI.h>
#include <renderer.h>
#undef SPRINT
#define SPRINT(A) {char str[32];sprintf(str,"val: %d ",A);Serial.println((char*)str);}

View File

@ -536,7 +536,6 @@ void ESPKNXIP::__loop_knx()
uint8_t buf[read];
udp.read(buf, read);
udp.flush();
DEBUG_PRINT(F("Got packet:"));

View File

@ -111,6 +111,9 @@ build_flags = ${esp_defaults.build_flags}
-lstdc++
; the following removes the 4-bytes alignment for PSTR(), waiting for a cleaner flag from Arduino Core
-DPSTR\(s\)=\(__extension__\(\{static\ const\ char\ __c\[\]\ __attribute__\(\(__aligned__\(1\)\)\)\ __attribute__\(\(section\(\ \"\\\\\".irom0.pstr.\"\ __FILE__\ \".\"\ __STRINGIZE\(__LINE__\)\ \".\"\ \ __STRINGIZE\(__COUNTER__\)\ \"\\\\\"\,\ \\\\\"aSM\\\\\"\,\ \@progbits\,\ 1\ \#\"\)\)\)\ =\ \(s\)\;\ \&__c\[0\]\;\}\)\)
-DPSTR_ALIGN=1
; restrict to minimal mime-types
-DMIMETYPE_MINIMAL
[irremoteesp_full]
build_flags = -DUSE_IR_REMOTE_FULL

View File

@ -1,7 +1,19 @@
## Unreleased (development)
### 8.3.1.1 20200518
- Add command ``Rule0`` to change global rule parameters
- Add more functionality to ``Switchmode`` 11 and 12 (#8450)
## Released
### 8.3.1 20200518
- Release Fred
### 8.3.0.2 20200517
- Change Hass discovery from using template name to new Device name (#8462)
- Add command ``DeviceName`` defaults to FriendlyName1 and replaces FriendlyName1 in GUI
### 8.3.0.1 20200514

View File

@ -28,7 +28,7 @@
* Use online command StateText to translate ON, OFF, HOLD and TOGGLE.
* Use online command Prefix to translate cmnd, stat and tele.
*
* Updated until v8.1.0.1
* Updated until v8.3.0.2
\*********************************************************************/
#define LANGUAGE_MODULE_NAME // Enable to display "Module Generic" (ie Spanish), Disable to display "Generic Module" (ie English)
@ -79,7 +79,7 @@
#define D_DATA "Datos"
#define D_DARKLIGHT "Oscuro"
#define D_DEBUG "Debug"
#define D_DEWPOINT "Dew point"
#define D_DEWPOINT "Punto de Rocío"
#define D_DISABLED "Deshabilitado"
#define D_DISTANCE "Distancia"
#define D_DNS_SERVER "Servidor DNS"
@ -98,8 +98,8 @@
#define D_FILE "Archivo"
#define D_FLOW_RATE "Caudal"
#define D_FREE_MEMORY "Memoria Libre"
#define D_PSR_MAX_MEMORY "PS-RAM Memory"
#define D_PSR_FREE_MEMORY "PS-RAM free Memory"
#define D_PSR_MAX_MEMORY "Memoria PS-RAM"
#define D_PSR_FREE_MEMORY "Memoria PS-RAM libre"
#define D_FREQUENCY "Frecuencia"
#define D_GAS "Gas"
#define D_GATEWAY "Gateway"
@ -140,7 +140,7 @@
#define D_PROGRAM_SIZE "Tamaño Programa"
#define D_PROJECT "Proyecto"
#define D_RAIN "Lluvia"
#define D_RANGE "Range"
#define D_RANGE "Rango"
#define D_RECEIVED "Recibido"
#define D_RESTART "Reiniciar"
#define D_RESTARTING "Reiniciando"
@ -302,7 +302,7 @@
#define D_OTHER_PARAMETERS "Otros parámetros"
#define D_TEMPLATE "Plantilla"
#define D_ACTIVATE "Activar"
#define D_DEVICE_NAME "Device Name"
#define D_DEVICE_NAME "Nombre de Dispositivo"
#define D_WEB_ADMIN_PASSWORD "Clave Administrador Web"
#define D_MQTT_ENABLE "Habilitar MQTT"
#define D_FRIENDLY_NAME "Nombre Amigable"
@ -780,27 +780,27 @@
#define D_SCRIPT_UPLOAD_FILES "Cargar Archivos"
//xsns_67_as3935.ino
#define D_AS3935_GAIN "gain:"
#define D_AS3935_ENERGY "energy:"
#define D_AS3935_DISTANCE "distance:"
#define D_AS3935_DISTURBER "disturber:"
#define D_AS3935_GAIN "Ganancia:"
#define D_AS3935_ENERGY "Energía:"
#define D_AS3935_DISTANCE "Distancia:"
#define D_AS3935_DISTURBER "Perturbancia:"
#define D_AS3935_VRMS "µVrms:"
#define D_AS3935_APRX "aprx.:"
#define D_AS3935_AWAY "away"
#define D_AS3935_LIGHT "lightning"
#define D_AS3935_OUT "lightning out of range"
#define D_AS3935_NOT "distance not determined"
#define D_AS3935_ABOVE "lightning overhead"
#define D_AS3935_NOISE "noise detected"
#define D_AS3935_DISTDET "disturber detected"
#define D_AS3935_INTNOEV "Interrupt with no Event!"
#define D_AS3935_NOMESS "listening..."
#define D_AS3935_ON "On"
#define D_AS3935_OFF "Off"
#define D_AS3935_INDOORS "Indoors"
#define D_AS3935_OUTDOORS "Outdoors"
#define D_AS3935_CAL_FAIL "calibration failed"
#define D_AS3935_CAL_OK "calibration set to:"
#define D_AS3935_APRX "aprox.:"
#define D_AS3935_AWAY "lejos"
#define D_AS3935_LIGHT "Relámpagos"
#define D_AS3935_OUT "Relámpagos fuera de rango"
#define D_AS3935_NOT "Distancia no determinada"
#define D_AS3935_ABOVE "Relámpagos cercanos"
#define D_AS3935_NOISE "Ruido detectado"
#define D_AS3935_DISTDET "Perturbancia detectada"
#define D_AS3935_INTNOEV "Interrupción sin evento!"
#define D_AS3935_NOMESS "Escuchando..."
#define D_AS3935_ON "Encendido"
#define D_AS3935_OFF "Apagado"
#define D_AS3935_INDOORS "Dentro de casa"
#define D_AS3935_OUTDOORS "Al aire libre"
#define D_AS3935_CAL_FAIL "Falló calibración"
#define D_AS3935_CAL_OK "Calibración a:"
//xsns_68_opentherm.ino
#define D_SENSOR_BOILER_OT_RX "OpenTherm RX"

View File

@ -97,9 +97,9 @@
#define D_FALSE "Falso"
#define D_FILE "File"
#define D_FLOW_RATE "Flusso dati"
#define D_FREE_MEMORY "Memoria Libera"
#define D_PSR_MAX_MEMORY "PS-RAM Memory"
#define D_PSR_FREE_MEMORY "PS-RAM free Memory"
#define D_FREE_MEMORY "Memoria libera"
#define D_PSR_MAX_MEMORY "PS-RAM - Memoria"
#define D_PSR_FREE_MEMORY "PS-RAM - Memoria libera"
#define D_FREQUENCY "Frequenza"
#define D_GAS "Gas"
#define D_GATEWAY "Gateway"
@ -302,7 +302,7 @@
#define D_OTHER_PARAMETERS "Altri parametri"
#define D_TEMPLATE "Modello"
#define D_ACTIVATE "Attiva"
#define D_DEVICE_NAME "Device Name"
#define D_DEVICE_NAME "Nome dispositivo"
#define D_WEB_ADMIN_PASSWORD "Password amministratore web"
#define D_MQTT_ENABLE "Abilita MQTT"
#define D_FRIENDLY_NAME "Nome amichevole"

View File

@ -1132,6 +1132,16 @@ bool ValidModule(uint32_t index)
return ValidTemplateModule(index);
}
bool ValidTemplate(const char *search) {
char template_name[strlen(SettingsText(SET_TEMPLATE_NAME)) +1];
char search_name[strlen(search) +1];
LowerCase(template_name, SettingsText(SET_TEMPLATE_NAME));
LowerCase(search_name, search);
return (strstr(template_name, search_name) != nullptr);
}
String AnyModuleName(uint32_t index)
{
if (USER_MODULE == index) {

View File

@ -1040,7 +1040,7 @@ void CmndModules(void)
uint32_t j = i ? midx +1 : 0;
if ((ResponseAppend_P(PSTR("\"%d\":\"%s\""), j, AnyModuleName(midx).c_str()) > (LOGSZ - TOPSZ)) || (i == sizeof(kModuleNiceList))) {
ResponseJsonEndEnd();
MqttPublishPrefixTopic_P(RESULT_OR_STAT, UpperCase(XdrvMailbox.command, XdrvMailbox.command));
MqttPublishPrefixTopic_P(RESULT_OR_STAT, XdrvMailbox.command);
jsflg = false;
lines++;
}
@ -1149,7 +1149,7 @@ void CmndGpios(void)
char stemp1[TOPSZ];
if ((ResponseAppend_P(PSTR("\"%d\":\"%s\""), ridx, GetTextIndexed(stemp1, sizeof(stemp1), midx, kSensorNames)) > (LOGSZ - TOPSZ)) || (i == ARRAY_SIZE(kGpioNiceList) -1)) {
ResponseJsonEndEnd();
MqttPublishPrefixTopic_P(RESULT_OR_STAT, UpperCase(XdrvMailbox.command, XdrvMailbox.command));
MqttPublishPrefixTopic_P(RESULT_OR_STAT, XdrvMailbox.command);
jsflg = false;
lines++;
}

157
tasmota/support_jpeg.ino Normal file
View File

@ -0,0 +1,157 @@
/*
jpeg_utils.c - Version header file for Tasmota
Copyright (C) 2020 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef ESP32
#ifdef JPEG_PICTS
#include "img_converters.h"
#include "esp_jpg_decode.h"
void rgb888_to_565(uint8_t *in, uint16_t *out, uint32_t len) {
uint8_t red, grn, blu;
uint16_t b , g, r;
for (uint32_t cnt=0; cnt<len; cnt++) {
red = *in++;
grn = *in++;
blu = *in++;
b = (blu >> 3) & 0x1f;
g = ((grn >> 2) & 0x3f) << 5;
r = ((red >> 3) & 0x1f) << 11;
*out++ = (r | g | b);
}
}
typedef struct {
uint16_t width;
uint16_t height;
uint16_t data_offset;
const uint8_t *input;
uint8_t *output;
} rgb_jpg_decoder;
//input buffer
static uint32_t _jpg_read(void * arg, size_t index, uint8_t *buf, size_t len)
{
rgb_jpg_decoder * jpeg = (rgb_jpg_decoder *)arg;
if(buf) {
memcpy(buf, jpeg->input + index, len);
}
return len;
}
//output buffer and image width
static bool _rgb_write(void * arg, uint16_t x, uint16_t y, uint16_t w, uint16_t h, uint8_t *data)
{
rgb_jpg_decoder * jpeg = (rgb_jpg_decoder *)arg;
if(!data){
if(x == 0 && y == 0){
//write start
jpeg->width = w;
jpeg->height = h;
//if output is null, this is BMP
if(!jpeg->output){
jpeg->output = (uint8_t *)malloc((w*h*3)+jpeg->data_offset);
if(!jpeg->output){
return false;
}
}
} else {
//write end
}
return true;
}
size_t jw = jpeg->width*3;
size_t t = y * jw;
size_t b = t + (h * jw);
size_t l = x * 3;
uint8_t *out = jpeg->output+jpeg->data_offset;
uint8_t *o = out;
size_t iy, ix;
w = w * 3;
for(iy=t; iy<b; iy+=jw) {
o = out+iy+l;
for(ix=0; ix<w; ix+= 3) {
o[ix] = data[ix+2];
o[ix+1] = data[ix+1];
o[ix+2] = data[ix];
}
data+=w;
}
return true;
}
esp_err_t esp_jpg_decode(size_t len, jpg_scale_t scale, jpg_reader_cb reader, jpg_writer_cb writer, void * arg);
bool jpg2rgb888(const uint8_t *src, size_t src_len, uint8_t * out, jpg_scale_t scale)
{
rgb_jpg_decoder jpeg;
jpeg.width = 0;
jpeg.height = 0;
jpeg.input = src;
jpeg.output = out;
jpeg.data_offset = 0;
if(esp_jpg_decode(src_len, scale, _jpg_read, _rgb_write, (void*)&jpeg) != ESP_OK){
return false;
}
return true;
}
// https://web.archive.org/web/20131016210645/http://www.64lines.com/jpeg-width-height
//Gets the JPEG size from the array of data passed to the function, file reference: http://www.obrador.com/essentialjpeg/headerinfo.htm
char get_jpeg_size(unsigned char* data, unsigned int data_size, unsigned short *width, unsigned short *height) {
//Check for valid JPEG image
int i=0; // Keeps track of the position within the file
if(data[i] == 0xFF && data[i+1] == 0xD8 && data[i+2] == 0xFF && data[i+3] == 0xE0) {
i += 4;
// Check for valid JPEG header (null terminated JFIF)
if(data[i+2] == 'J' && data[i+3] == 'F' && data[i+4] == 'I' && data[i+5] == 'F' && data[i+6] == 0x00) {
//Retrieve the block length of the first block since the first block will not contain the size of file
unsigned short block_length = data[i] * 256 + data[i+1];
while(i<data_size) {
i+=block_length; //Increase the file index to get to the next block
if(i >= data_size) return false; //Check to protect against segmentation faults
if(data[i] != 0xFF) return false; //Check that we are truly at the start of another block
if(data[i+1] == 0xC0) { //0xFFC0 is the "Start of frame" marker which contains the file size
//The structure of the 0xFFC0 block is quite simple [0xFFC0][ushort length][uchar precision][ushort x][ushort y]
*height = data[i+5]*256 + data[i+6];
*width = data[i+7]*256 + data[i+8];
return true;
}
else
{
i+=2; //Skip the block marker
block_length = data[i] * 256 + data[i+1]; //Go to the next block
}
}
return false; //If this point is reached then no size was found
}else{ return false; } //Not a valid JFIF string
}else{ return false; } //Not a valid SOI header
}
#endif // JPEG_PICTS
#endif //ESP32

View File

@ -154,8 +154,15 @@ void SwitchHandler(uint8_t mode)
if (Switch.hold_timer[i]) {
Switch.hold_timer[i]--;
if (Switch.hold_timer[i] == loops_per_second * Settings.param[P_HOLD_TIME] / 25) {
if ((Settings.switchmode[i] == PUSHHOLDMULTI) & (NOT_PRESSED == Switch.last_state[i])) {
SendKey(KEY_SWITCH, i +1, POWER_INCREMENT); // Execute command via MQTT
}
if ((Settings.switchmode[i] == PUSHHOLDMULTI_INV) & (PRESSED == Switch.last_state[i])) {
SendKey(KEY_SWITCH, i +1, POWER_INCREMENT); // Execute command via MQTT
}
}
if (0 == Switch.hold_timer[i]) {
switch (Settings.switchmode[i]) {
case TOGGLEMULTI:
switchflag = POWER_TOGGLE; // Toggle after hold
@ -202,51 +209,33 @@ void SwitchHandler(uint8_t mode)
switchflag = ~button &1; // Follow inverted wall switch state
break;
case PUSHBUTTON:
// if ((PRESSED == button) && (NOT_PRESSED == Switch.last_state[i])) {
if (PRESSED == button) {
switchflag = POWER_TOGGLE; // Toggle with pushbutton to Gnd
}
break;
case PUSHBUTTON_INV:
// if ((NOT_PRESSED == button) && (PRESSED == Switch.last_state[i])) {
if (NOT_PRESSED == button) {
switchflag = POWER_TOGGLE; // Toggle with releasing pushbutton from Gnd
}
break;
case PUSHBUTTONHOLD:
// if ((PRESSED == button) && (NOT_PRESSED == Switch.last_state[i])) {
if (PRESSED == button) {
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10; // Start timer on button press
}
// if ((NOT_PRESSED == button) && (PRESSED == Switch.last_state[i]) && (Switch.hold_timer[i])) {
if ((NOT_PRESSED == button) && (Switch.hold_timer[i])) {
Switch.hold_timer[i] = 0; // Button released and hold timer not expired : stop timer...
switchflag = POWER_TOGGLE; // ...and Toggle
}
break;
case PUSHBUTTONHOLD_INV:
// if ((NOT_PRESSED == button) && (PRESSED == Switch.last_state[i])) {
if (NOT_PRESSED == button) {
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10; // Start timer on button press...
}
// if ((PRESSED == button) && (NOT_PRESSED == Switch.last_state[i]) && (Switch.hold_timer[i])) {
if ((PRESSED == button) && (Switch.hold_timer[i])) {
Switch.hold_timer[i] = 0; // Button released and hold timer not expired : stop timer.
switchflag = POWER_TOGGLE; // ...and Toggle
}
break;
/*
// Reverted Fix switchmode 6 according to issue 7778 (#7831)
case PUSHBUTTONHOLD_INV:
if ((PRESSED == button) && (NOT_PRESSED == Switch.last_state[i])) {
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10; // Start timer on button press...
switchflag = POWER_TOGGLE; // ...and Toggle
}
if ((NOT_PRESSED == button) && (PRESSED == Switch.last_state[i])) {
Switch.hold_timer[i] = 0; // Button released : stop timer.
}
break;
*/
case TOGGLEMULTI:
case FOLLOWMULTI:
case FOLLOWMULTI_INV:
@ -258,36 +247,32 @@ void SwitchHandler(uint8_t mode)
}
break;
case PUSHHOLDMULTI:
// if ((NOT_PRESSED == button) && (PRESSED == Switch.last_state[i])) {
if (NOT_PRESSED == button) {
if (Switch.hold_timer[i] != 0) {
SendKey(KEY_SWITCH, i +1, POWER_INV); // Execute command via MQTT
}
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10;
}
// if ((PRESSED == button) && (NOT_PRESSED == Switch.last_state[i])) {
if (PRESSED == button) {
} else {
if (Switch.hold_timer[i] > loops_per_second * Settings.param[P_HOLD_TIME] / 25) {
switchflag = POWER_TOGGLE; // Toggle with pushbutton
} else {
SendKey(KEY_SWITCH, i +1, POWER_RELEASE); // Execute command via MQTT
}
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10;
}
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10;
break;
case PUSHHOLDMULTI_INV:
// if ((PRESSED == button) && (NOT_PRESSED == Switch.last_state[i])) {
if (PRESSED == button) {
if (Switch.hold_timer[i] != 0) {
SendKey(KEY_SWITCH, i +1, POWER_INV); // Execute command via MQTT
}
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10;
}
// if ((NOT_PRESSED == button) && (PRESSED == Switch.last_state[i])) {
if (NOT_PRESSED == button) {
} else {
if (Switch.hold_timer[i] > loops_per_second * Settings.param[P_HOLD_TIME] / 25) {
switchflag = POWER_TOGGLE; // Toggle with pushbutton
} else {
SendKey(KEY_SWITCH, i +1, POWER_RELEASE); // Execute command via MQTT
}
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10;
}
Switch.hold_timer[i] = loops_per_second * Settings.param[P_HOLD_TIME] / 10;
break;
case PUSHON:
if (PRESSED == button) {

View File

@ -423,6 +423,10 @@ bool SendKey(uint32_t key, uint32_t device, uint32_t state)
// state 1 = POWER_ON = on
// state 2 = POWER_TOGGLE = toggle
// state 3 = POWER_HOLD = hold
// state 4 = POWER_INCREMENT = button still pressed
// state 5 = POWER_INV = button released
// state 6 = POWER_CLEAR = button released
// state 7 = POWER_RELEASE = button released
// state 9 = CLEAR_RETAIN = clear retain flag
char stopic[TOPSZ];
@ -1232,7 +1236,7 @@ void SerialInput(void)
}
else if ((serial_in_byte_counter == INPUT_BUFFER_SIZE)
#ifdef ESP8266
|| Serial.hasOverrun() // Default ESP8266 Serial buffer size is 256. Tasmota increases to INPUT_BUFFER_SIZE
|| Serial.hasOverrun()
#endif
) {
serial_buffer_overrun = true;

View File

@ -232,7 +232,7 @@ enum TopicOptions { CMND, STAT, TELE, nu1, RESULT_OR_CMND, RESULT_OR_STAT, RESUL
enum ExecuteCommandPowerOptions { POWER_OFF, POWER_ON, POWER_TOGGLE, POWER_BLINK, POWER_BLINK_STOP,
POWER_OFF_NO_STATE = 8, POWER_ON_NO_STATE, POWER_TOGGLE_NO_STATE,
POWER_SHOW_STATE = 16 };
enum SendKeyPowerOptions { POWER_HOLD = 3, POWER_INCREMENT = 4, POWER_INV = 5, POWER_CLEAR = 6, CLEAR_RETAIN = 9 };
enum SendKeyPowerOptions { POWER_HOLD = 3, POWER_INCREMENT = 4, POWER_INV = 5, POWER_CLEAR = 6, POWER_RELEASE = 7, CLEAR_RETAIN = 9 };
enum SendKeyOptions { KEY_BUTTON, KEY_SWITCH };
enum SendKeyMultiClick { SINGLE = 10, DOUBLE = 11, TRIPLE = 12, QUAD = 13, PENTA = 14};

View File

@ -20,7 +20,7 @@
#ifndef _TASMOTA_VERSION_H_
#define _TASMOTA_VERSION_H_
const uint32_t VERSION = 0x08030002;
const uint32_t VERSION = 0x08030101;
// Lowest compatible version
const uint32_t VERSION_COMPATIBLE = 0x07010006;

View File

@ -1954,6 +1954,26 @@ void RulesPreprocessCommand(char *pCommands)
void CmndRule(void)
{
if (0 == XdrvMailbox.index) {
char data = '\0';
if (XdrvMailbox.data_len > 0) { // Allow show all if 0
if (!((XdrvMailbox.payload >= 0) && (XdrvMailbox.payload <= 10))) {
if ('"' == XdrvMailbox.data[0]) {
data = '"'; // Save data as XdrvMailbox.data is destroyed
} else {
XdrvMailbox.data_len = 0; // Discard any additional text
}
}
}
for (uint32_t i = 1; i <= MAX_RULE_SETS; i++) {
XdrvMailbox.index = i;
XdrvMailbox.data[0] = data; // Only 0 or "
CmndRule();
MqttPublishPrefixTopic_P(RESULT_OR_STAT, XdrvMailbox.command);
}
mqtt_data[0] = '\0'; // Disable further processing
return;
}
uint8_t index = XdrvMailbox.index;
if ((index > 0) && (index <= MAX_RULE_SETS)) {
// if ((XdrvMailbox.data_len > 0) && (XdrvMailbox.data_len < sizeof(Settings.rules[index -1]))) { // TODO postpone size calculation

View File

@ -66,8 +66,9 @@ keywords if then else endif, or, and are better readable for beginners (others m
uint32_t EncodeLightId(uint8_t relay_id);
uint32_t DecodeLightId(uint32_t hue_id);
#if defined(ESP32) && defined(ESP32_SCRIPT_SIZE) && !defined(USE_24C256) && !defined(USE_SCRIPT_FATFS)
#include <unishox.h>
#if defined(ESP32) && defined(ESP32_SCRIPT_SIZE) && !defined(USE_24C256) && !defined(USE_SCRIPT_FATFS)
#include "FS.h"
#include "SPIFFS.h"
@ -3035,7 +3036,7 @@ int16_t Run_Scripter(const char *type, int8_t tlen, char *js) {
uint8_t index=glob_script_mem.type[ind.index].index;
if ((vtype&STYPE)==0) {
// numeric result
if (glob_script_mem.type[index].bits.is_filter) {
if (glob_script_mem.type[ind.index].bits.is_filter) {
uint8_t len=0;
float *fa=Get_MFAddr(index,&len);
//Serial.printf(">> 2 %d\n",(uint32_t)*fa);
@ -3592,6 +3593,11 @@ const char HTTP_FORM_SDC_HREF[] PROGMEM =
uint8_t reject(char *name) {
char *lcp = strrchr(name,'/');
if (lcp) {
name=lcp+1;
}
while (*name=='/') name++;
if (*name=='_') return 1;
if (*name=='.') return 1;
@ -3960,6 +3966,25 @@ void ScriptSaveSettings(void) {
glob_script_mem.script_mem_size=0;
}
#ifndef UNISHOXRSIZE
#define UNISHOXRSIZE 2560
#endif
#ifdef USE_RULES_COMPRESSION
#ifndef USE_24C256
#ifndef USE_SCRIPT_FATFS
#ifndef ESP32_SCRIPT_SIZE
uint32_t len_compressed = unishox_compress(glob_script_mem.script_ram, strlen(glob_script_mem.script_ram), Settings.rules[0], UNISHOXRSIZE);
if (len_compressed > 0) {
AddLog_P2(LOG_LEVEL_INFO,PSTR("compressed to %d"),len_compressed * 100 / strlen(glob_script_mem.script_ram));
} else {
AddLog_P2(LOG_LEVEL_INFO, PSTR("script compress error: %d"), len_compressed);
}
#endif
#endif
#endif
#endif // USE_RULES_COMPRESSION
if (bitRead(Settings.rule_enabled, 0)) {
int16_t res=Init_Scripter();
if (res) {
@ -4863,6 +4888,34 @@ const char SCRIPT_MSG_TEXTINP[] PROGMEM =
const char SCRIPT_MSG_NUMINP[] PROGMEM =
"<div><center><label><b>%s</b><input min='%s' max='%s' step='%s' value='%s' type='number' style='width:200px' onfocusin='pr(0)' onfocusout='pr(1)' onchange='siva(value,\"%s\")'></label></div>";
const char SCRIPT_MSG_GTABLE[] PROGMEM =
"<script type='text/javascript' src='https://www.gstatic.com/charts/loader.js'></script>"
"<script type='text/javascript'>google.charts.load('current',{packages:['corechart']});</script>"
"<script type='text/javascript'>google.charts.load('current',{packages:['table']});</script>"
"<script type='text/javascript'>google.charts.load('current',{packages:['gauge']});</script>"
"<style>.hRow{font-weight:bold;color:black;background-color:lightblue;}.hCol{font-weight:bold;color:black;background-color:lightblue;}.tCell{color:black}</style>";
const char SCRIPT_MSG_GTABLEa[] PROGMEM =
"<script language='JavaScript'>function drawChart(){"
"var cssc={'headerRow':'hRow','rowNumberCell':'hCol','tableCell':'tCell'};"
"var data=google.visualization.arrayToDataTable([";
const char SCRIPT_MSG_GTABLEb[] PROGMEM =
"]);"
"var options={%s};"
"var chart=new google.visualization.%s(document.getElementById('chart%1d'));"
"chart.draw(data,options);}"
"google.charts.setOnLoadCallback(drawChart);</script>";
const char SCRIPT_MSG_GOPT1[] PROGMEM =
"title:'%s',isStacked:false";
const char SCRIPT_MSG_GOPT2[] PROGMEM =
"showRowNumber:true,sort:'disable',allowHtml:true,width:'100%%',height:'100%%',cssClassNames:cssc";
const char SCRIPT_MSG_GTE1[] PROGMEM = "'%s'";
void ScriptGetVarname(char *nbuf,char *sp, uint32_t blen) {
uint32_t cnt;
@ -4881,6 +4934,8 @@ void ScriptWebShow(char mc) {
char line[128];
char tmp[128];
uint8_t optflg=0;
uint8_t chartindex=1;
uint8_t google_libs=0;
char *lp=glob_script_mem.section_ptr+2;
while (lp) {
while (*lp==SCRIPT_EOL) {
@ -4911,7 +4966,6 @@ void ScriptWebShow(char mc) {
optflg=0;
}
// check for input elements
if (!strncmp(lin,"sl(",3)) {
// insert slider sl(min max var left mid right)
@ -5062,7 +5116,6 @@ void ScriptWebShow(char mc) {
dtostrfd(max,4,maxstr);
dtostrfd(step,4,stepstr);
WSContentSend_PD(SCRIPT_MSG_NUMINP,label,minstr,maxstr,stepstr,vstr,vname);
} else {
Replace_Cmd_Vars(lin,0,tmp,sizeof(tmp));
if (optflg) {
@ -5073,8 +5126,142 @@ void ScriptWebShow(char mc) {
}
} else {
if (*lin==mc) {
Replace_Cmd_Vars(lin+1,0,tmp,sizeof(tmp));
WSContentSend_PD(PSTR("%s"),tmp);
lin++;
if (!strncmp(lin,"tb(",3)) {
// get google table
struct T_INDEX ind;
uint8_t vtype;
char *lp=lin+3;
uint8 entries=0;
#define MAX_GARRAY 4
float *arrays[MAX_GARRAY];
uint8_t anum=0;
while (anum<MAX_GARRAY) {
if (*lp==')' || *lp==0) break;
char *lp1=lp;
lp=isvar(lp,&vtype,&ind,0,0,0);
if (vtype!=VAR_NV) {
SCRIPT_SKIP_SPACES
uint8_t index=glob_script_mem.type[ind.index].index;
if ((vtype&STYPE)==0) {
// numeric result
//Serial.printf("numeric %d - %d \n",ind.index,index);
if (glob_script_mem.type[ind.index].bits.is_filter) {
//Serial.printf("numeric array\n");
uint8_t len=0;
float *fa=Get_MFAddr(index,&len);
//Serial.printf(">> 2 %d\n",(uint32_t)*fa);
if (fa && len>=entries) {
if (!entries) {entries = len;}
// add array to list
arrays[anum]=fa;
anum++;
}
}
} else {
lp=lp1;
break;
}
}
}
//Serial.printf("arrays %d\n",anum);
//Serial.printf("entries %d\n",entries);
if (!google_libs) {
WSContentSend_PD(SCRIPT_MSG_GTABLE);
google_libs=1;
}
WSContentSend_PD(SCRIPT_MSG_GTABLEa);
// we know how many arrays and the number of entries
// we need to fetch the labels now
WSContentSend_PD("[");
for (uint32_t cnt=0; cnt<anum+1; cnt++) {
char label[SCRIPT_MAXSSIZE];
lp=GetStringResult(lp,OPER_EQU,label,0);
SCRIPT_SKIP_SPACES
WSContentSend_PD(SCRIPT_MSG_GTE1,label);
//Serial.printf("labels %s\n",label);
if (cnt<anum) { WSContentSend_PD(","); }
}
WSContentSend_PD("],");
// now we have to export the values
// fetch label part only once in combo string
char label[SCRIPT_MAXSSIZE];
lp=GetStringResult(lp,OPER_EQU,label,0);
SCRIPT_SKIP_SPACES
char *lblp=label;
for (uint32_t cnt=0; cnt<entries; cnt++) {
WSContentSend_PD("['");
char lbl[16];
strncpy(lbl,lblp,sizeof(lbl));
for (uint32_t i=0; i<strlen(lblp); i++) {
if (lblp[i]=='|') {
lbl[i]=0;
lblp+=i+1;
break;
}
lbl[i]=lblp[i];
}
WSContentSend_PD(lbl);
WSContentSend_PD("',");
for (uint32_t ind=0; ind<anum; ind++) {
char acbuff[32];
float *fp=arrays[ind];
dtostrfd(fp[cnt],glob_script_mem.script_dprec,acbuff);
WSContentSend_PD("%s",acbuff);
if (ind<anum-1) { WSContentSend_PD(","); }
}
WSContentSend_PD("]");
if (cnt<entries-1) { WSContentSend_PD(","); }
}
char header[SCRIPT_MAXSSIZE];
lp=GetStringResult(lp,OPER_EQU,header,0);
SCRIPT_SKIP_SPACES
char options[128];
snprintf_P(options,sizeof(options),SCRIPT_MSG_GOPT1,header);
const char *type;
if (*lp!=')') {
switch (*lp) {
case 'l':
type=PSTR("LineChart");
break;
case 'b':
type=PSTR("BarChart");
break;
case 'p':
type=PSTR("PieChart");
break;
case 'g':
type=PSTR("Gauge");
break;
case 't':
type=PSTR("Table");
snprintf_P(options,sizeof(options),SCRIPT_MSG_GOPT2);
break;
case 'h':
type=PSTR("Histogram");
break;
default:
type=PSTR("ColumnChart");
break;
}
} else {
type=PSTR("ColumnChart");
}
WSContentSend_PD(SCRIPT_MSG_GTABLEb,options,type,chartindex);
chartindex++;
} else {
Replace_Cmd_Vars(lin,0,tmp,sizeof(tmp));
WSContentSend_PD(PSTR("%s"),tmp);
}
}
}
}
@ -5232,6 +5419,7 @@ uint32_t scripter_create_task(uint32_t num, uint32_t time, uint32_t core) {
* Interface
\*********************************************************************************************/
bool Xdrv10(uint8_t function)
{
bool result = false;
@ -5246,6 +5434,19 @@ bool Xdrv10(uint8_t function)
glob_script_mem.script_pram=(uint8_t*)Settings.script_pram[0];
glob_script_mem.script_pram_size=PMEM_SIZE;
#ifdef USE_RULES_COMPRESSION
#ifndef USE_24C256
#ifndef USE_SCRIPT_FATFS
#ifndef ESP32_SCRIPT_SIZE
glob_script_mem.script_ram=(char*)calloc(UNISHOXRSIZE+8,1);
if (!glob_script_mem.script_ram) { break; }
unishox_decompress(Settings.rules[0], strlen(Settings.rules[0]), glob_script_mem.script_ram, UNISHOXRSIZE);
glob_script_mem.script_size=UNISHOXRSIZE;
#endif
#endif
#endif
#endif // USE_RULES_COMPRESSION
#ifdef USE_BUTTON_EVENT
for (uint32_t cnt=0;cnt<MAX_KEYS;cnt++) {
script_button[cnt]=-1;
@ -5323,6 +5524,7 @@ bool Xdrv10(uint8_t function)
script=(char*)calloc(ESP32_SCRIPT_SIZE+4,1);
if (!script) break;
LoadFile("/script.txt",(uint8_t*)script,ESP32_SCRIPT_SIZE);
glob_script_mem.script_ram=script;
glob_script_mem.script_size=ESP32_SCRIPT_SIZE;
script[ESP32_SCRIPT_SIZE-1]=0;
@ -5437,6 +5639,5 @@ bool Xdrv10(uint8_t function)
}
#endif // Do not USE_RULES
#endif // USE_SCRIPT

View File

@ -1500,47 +1500,109 @@ void CmndDisplayRows(void)
/*********************************************************************************************\
* optional drivers
\*********************************************************************************************/
#ifdef ESP32
#ifdef JPEG_PICTS
#include "img_converters.h"
#include "esp_jpg_decode.h"
bool jpg2rgb888(const uint8_t *src, size_t src_len, uint8_t * out, jpg_scale_t scale);
char get_jpeg_size(unsigned char* data, unsigned int data_size, unsigned short *width, unsigned short *height);
void rgb888_to_565(uint8_t *in, uint16_t *out, uint32_t len);
#endif
#endif
#if defined(USE_SCRIPT_FATFS) && defined(USE_SCRIPT)
#define XBUFF_LEN 128
void Draw_RGB_Bitmap(char *file,uint16_t xp, uint16_t yp) {
if (!renderer) return;
//if (!strstr(file,".RGB")) return;
File fp;
fp=SD.open(file,FILE_READ);
if (!fp) return;
uint16_t xsize;
fp.read((uint8_t*)&xsize,2);
uint16_t ysize;
fp.read((uint8_t*)&ysize,2);
char *ending = strrchr(file,'.');
if (!ending) return;
ending++;
char estr[8];
memset(estr,0,sizeof(estr));
for (uint32_t cnt=0; cnt<strlen(ending); cnt++) {
estr[cnt]=tolower(ending[cnt]);
}
if (!strcmp(estr,"rgb")) {
// special rgb format
fp=SD.open(file,FILE_READ);
if (!fp) return;
uint16_t xsize;
fp.read((uint8_t*)&xsize,2);
uint16_t ysize;
fp.read((uint8_t*)&ysize,2);
#if 1
#define XBUFF 128
uint16_t xdiv=xsize/XBUFF;
renderer->setAddrWindow(xp,yp,xp+xsize,yp+ysize);
for(int16_t j=0; j<ysize; j++) {
for(int16_t i=0; i<xsize; i+=XBUFF) {
uint16_t rgb[XBUFF];
uint16_t len=fp.read((uint8_t*)rgb,XBUFF*2);
if (len>=2) renderer->pushColors(rgb,len/2,true);
uint16_t xdiv=xsize/XBUFF_LEN;
renderer->setAddrWindow(xp,yp,xp+xsize,yp+ysize);
for(int16_t j=0; j<ysize; j++) {
for(int16_t i=0; i<xsize; i+=XBUFF_LEN) {
uint16_t rgb[XBUFF_LEN];
uint16_t len=fp.read((uint8_t*)rgb,XBUFF_LEN*2);
if (len>=2) renderer->pushColors(rgb,len/2,true);
}
OsWatchLoop();
}
OsWatchLoop();
}
renderer->setAddrWindow(0,0,0,0);
renderer->setAddrWindow(0,0,0,0);
#else
for(int16_t j=0; j<ysize; j++) {
for(int16_t i=0; i<xsize; i++ ) {
uint16_t rgb;
uint8_t res=fp.read((uint8_t*)&rgb,2);
if (!res) break;
renderer->writePixel(xp+i,yp,rgb);
for(int16_t j=0; j<ysize; j++) {
for(int16_t i=0; i<xsize; i++ ) {
uint16_t rgb;
uint8_t res=fp.read((uint8_t*)&rgb,2);
if (!res) break;
renderer->writePixel(xp+i,yp,rgb);
}
delay(0);
OsWatchLoop();
yp++;
}
delay(0);
OsWatchLoop();
yp++;
}
#endif
fp.close();
fp.close();
} else if (!strcmp(estr,"jpg")) {
// jpeg files on ESP32 with more memory
#ifdef ESP32
#ifdef JPEG_PICTS
if (psramFound()) {
fp=SD.open(file,FILE_READ);
if (!fp) return;
uint32_t size = fp.size();
uint8_t *mem = (uint8_t *)heap_caps_malloc(size+4, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
if (mem) {
uint8_t res=fp.read(mem, size);
if (res) {
uint16_t xsize;
uint16_t ysize;
if (mem[0]==0xff && mem[1]==0xd8) {
get_jpeg_size(mem, size, &xsize, &ysize);
//Serial.printf(" x,y %d - %d\n",xsize, ysize );
if (xsize && ysize) {
uint8_t *out_buf = (uint8_t *)heap_caps_malloc((xsize*ysize*3)+4, MALLOC_CAP_SPIRAM | MALLOC_CAP_8BIT);
if (out_buf) {
uint8_t *ob=out_buf;
jpg2rgb888(mem, size, out_buf, (jpg_scale_t)JPG_SCALE_NONE);
uint16_t pixels=xsize*ysize/XBUFF_LEN;
renderer->setAddrWindow(xp,yp,xp+xsize,yp+ysize);
for(int32_t j=0; j<pixels; j++) {
uint16_t rbuff[XBUFF_LEN*2];
rgb888_to_565(ob, rbuff, XBUFF_LEN);
ob+=XBUFF_LEN*3;
renderer->pushColors(rbuff,XBUFF_LEN,true);
OsWatchLoop();
}
renderer->setAddrWindow(0,0,0,0);
free(out_buf);
}
}
}
}
free(mem);
}
fp.close();
}
#endif // JPEG_PICTS
#endif // ESP32
}
}
#endif

View File

@ -45,7 +45,6 @@
#define D_CMND_CFGDUMP "CfgDump"
#define D_CMND_CFGPEEK "CfgPeek"
#define D_CMND_CFGPOKE "CfgPoke"
#define D_CMND_CFGSHOW "CfgShow"
#define D_CMND_CFGXOR "CfgXor"
#define D_CMND_CPUCHECK "CpuChk"
#define D_CMND_EXCEPTION "Exception"
@ -459,7 +458,9 @@ void CmndCfgXor(void)
if (XdrvMailbox.data_len > 0) {
Web.config_xor_on_set = XdrvMailbox.payload;
}
ResponseCmndNumber(Web.config_xor_on_set);
char temp[10];
snprintf_P(temp, sizeof(temp), PSTR("0x%02X"), Web.config_xor_on_set);
ResponseCmndChar(temp);
}
#endif // USE_WEBSERVER

View File

@ -71,11 +71,24 @@ void RA8876_InitDriver()
fg_color = RA8876_WHITE;
bg_color = RA8876_BLACK;
#ifdef ESP32
#define HW_SPI_MOSI 23
#define HW_SPI_MISO 19
#define HW_SPI_CLK 18
#else
#undef HW_SPI_MOSI
#define HW_SPI_MOSI 13
#undef HW_SPI_MISO
#define HW_SPI_MISO 12
#undef HW_SPI_CLK
#define HW_SPI_CLK 14
#endif
// init renderer, must use hardware spi
if (PinUsed(GPIO_SSPI_CS) && (Pin(GPIO_SSPI_MOSI)==13) && (Pin(GPIO_SSPI_MISO)==12) && (Pin(GPIO_SSPI_SCLK)==14)) {
if (PinUsed(GPIO_SSPI_CS) && (Pin(GPIO_SSPI_MOSI)==HW_SPI_MOSI) && (Pin(GPIO_SSPI_MISO)==HW_SPI_MISO) && (Pin(GPIO_SSPI_SCLK)==HW_SPI_CLK)) {
ra8876 = new RA8876(Pin(GPIO_SSPI_CS),Pin(GPIO_SSPI_MOSI),Pin(GPIO_SSPI_MISO),Pin(GPIO_SSPI_SCLK),Pin(GPIO_BACKLIGHT));
} else {
if (PinUsed(GPIO_SPI_CS) && (Pin(GPIO_SPI_MOSI)==13) && (Pin(GPIO_SPI_MISO)==12) && (Pin(GPIO_SPI_CLK)==14)) {
if (PinUsed(GPIO_SPI_CS) && (Pin(GPIO_SPI_MOSI)==HW_SPI_MOSI) && (Pin(GPIO_SPI_MISO)==HW_SPI_MISO) && (Pin(GPIO_SPI_CLK)==HW_SPI_CLK)) {
ra8876 = new RA8876(Pin(GPIO_SPI_CS),Pin(GPIO_SPI_MOSI),Pin(GPIO_SPI_MISO),Pin(GPIO_SPI_CLK),Pin(GPIO_BACKLIGHT));
} else {
return;

View File

@ -0,0 +1,98 @@
#!/usr/bin/env python3
"""
templates.py - template beautify TEMPLATES.md for Tasmota
Copyright (C) 2020 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Requirements:
- Python
- pip pycurl certifi
Instructions:
Execute command to produce file TEMPLATE.md as found in the Tasmota root folder
Usage:
python templates.py
"""
import io
import pycurl
import certifi
from io import BytesIO
from io import StringIO
from datetime import datetime
column = 27 # Start position of {"NAME":... in line
def main():
print ("\n*** templates.py v20200514 by Theo Arends ***")
# Download from template website
buffer = BytesIO()
url = "https://templates.blakadder.com/list.json"
c = pycurl.Curl()
c.setopt(c.URL, url)
c.setopt(c.WRITEDATA, buffer)
c.setopt(c.CAINFO, certifi.where())
c.perform()
c.close()
body = buffer.getvalue()
fin = StringIO(body.decode('UTF-8'))
now = datetime.now()
month = now.strftime('%B')
year = now.strftime('%Y')
# Write to root/TEMPLATES.md
fout = open("..\..\TEMPLATES.md","w+")
fout.write("<img src=\"/tools/logo/TASMOTA_FullLogo_Vector.svg\" alt=\"Logo\" align=\"right\" height=\"76\"/>\n")
fout.write("\n")
fout.write("# Templates\n")
fout.write("\n")
fout.write("Find below the available templates as of " + month + " " + year + ". More template information can be found in the [Tasmota Device Templates Repository](http://blakadder.github.io/templates)\n")
not_first = 0
fline = fin.readlines()
for line in fline:
if line.strip():
if line.startswith("##"):
if not_first:
fout.write('```\n')
fout.write('\n')
fout.write(line)
fout.write('```\n')
not_first = 1
elif line.startswith("#"):
noop = 0
else:
pos1 = line.find("{")
if pos1 < column:
a = column + 2 - pos1
lout = line[0:pos1 - 4] + " "*a + line[pos1:len(line)]
else:
lout = line[0:pos1 - 4] + " " + line[pos1:len(line)]
fout.write(lout)
fout.write('```\n')
fout.close()
fin.close()
if __name__ == "__main__":
main()