Remove settings_entity (#887)
* Remove `settings_entity` - Bump version to 3.5_dev - Removed references to pictures removed from TFT - Removed code related to closing settings pages - Removed trigger `settings_entity` * Removed `set_settings_entity` service - Bump version to 3.5_dev - Removed `set_settings_entity` service - BREAKING CHANGE - Removed `settings_entity` text-sensor - BREAKING CHANGE - Added service `open_entity_settings_page` - BREAKING CHANGE * Removed `settings_entity` - Bump version to 3.5_dev - Removed old climate page (climate_backup) - Removed pics related to old climate page (ids 16-47, 80-83, 95-96 and 125(US only)) - Enforces brightness on any page change (this allows wake-up on settings page with long press on physical buttons) - Pending removing code from Blueprint - Added `entity` variable on pages `climate`, `lightsettings` and `coversettings` - Added `entity` info to `nspanelevent` on pages `climate`, `lightsettings` and `coversettings` - Added `back_page` variable on pages `climate`, `lightsettings` and `coversettings` (default: home) - Moving to TFT close page logic on pages `climate`, `lightsettings` and `coversettings` - Pending changes on Blueprint and ESPHome - Standardized name for `page_label` on pages `climate`, `lightsettings` and `coversettings` - Standardized settings page names: `climate`, `cover` and `light` (Removed `settings` from page name) * Removed `settings_entity` * Removed `settings_entity` * Removed `settings_entity`
This commit is contained in:
@@ -12,6 +12,7 @@ Page boot
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=100
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
@@ -86,7 +87,7 @@ Text tft_version
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text : 3.4
|
||||
Text : 3.5_dev
|
||||
Max. Text Size : 8
|
||||
|
||||
Text esph_version
|
||||
|
||||
291
nspanel_us_code/cover.txt
Normal file
291
nspanel_us_code/cover.txt
Normal file
@@ -0,0 +1,291 @@
|
||||
Page cover
|
||||
Attributes
|
||||
ID : 0
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Locked : no
|
||||
Swide up page ID : disabled
|
||||
Swide down page ID : disabled
|
||||
Swide left page ID : disabled
|
||||
Swide right page ID: disabled
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=home.brightness.val
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Touch Press Event
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "touchevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Touch Release Event
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"touchevent\", \"value\": \"release\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "touchevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Variable (string) va1
|
||||
Attributes
|
||||
ID : 9
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 10
|
||||
|
||||
Variable (string) coversetting
|
||||
Attributes
|
||||
ID : 15
|
||||
Scope : local
|
||||
Text :
|
||||
Max. Text Size: 255
|
||||
|
||||
Variable (string) entity
|
||||
Attributes
|
||||
ID : 16
|
||||
Scope : global
|
||||
Text :
|
||||
Max. Text Size: 100
|
||||
|
||||
Variable (string) back_page
|
||||
Attributes
|
||||
ID : 17
|
||||
Scope : local
|
||||
Text : home
|
||||
Max. Text Size: 15
|
||||
|
||||
Text battery_value
|
||||
Attributes
|
||||
ID : 1
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Text cover_value
|
||||
Attributes
|
||||
ID : 2
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Text page_label
|
||||
Attributes
|
||||
ID : 3
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 25
|
||||
|
||||
Text icon_state
|
||||
Attributes
|
||||
ID : 13
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Text battery_icon
|
||||
Attributes
|
||||
ID : 14
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Picture cover_exit
|
||||
Attributes
|
||||
ID : 11
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Slider coverslider
|
||||
Attributes
|
||||
ID : 6
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
Position : 0
|
||||
Upper range limit: 100
|
||||
Lower range limit: 0
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
covx coverslider.val,va1.txt,0,0
|
||||
cover_value.txt=va1.txt+"%"
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"cover_position\", \"value\": "+va1.txt+", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Button cover_open
|
||||
Attributes
|
||||
ID : 4
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
State : unpressed
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"open_cover\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Button cover_close
|
||||
Attributes
|
||||
ID : 5
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
State : unpressed
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"close_cover\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Button cover_stop
|
||||
Attributes
|
||||
ID : 10
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
State : unpressed
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
coversetting.txt="{\"page\": \"cover\", \"component\": \"stop_cover\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints coversetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Hotspot cover_back
|
||||
Attributes
|
||||
ID : 12
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
if(back_page.txt=="buttonpage01")
|
||||
{
|
||||
page buttonpage01
|
||||
}else if(back_page.txt=="buttonpage02")
|
||||
{
|
||||
page buttonpage02
|
||||
}else if(back_page.txt=="buttonpage03")
|
||||
{
|
||||
page buttonpage03
|
||||
}else if(back_page.txt=="buttonpage04")
|
||||
{
|
||||
page buttonpage04
|
||||
}else
|
||||
{
|
||||
page home
|
||||
}
|
||||
|
||||
Timer swipestore
|
||||
Attributes
|
||||
ID : 8
|
||||
Scope : local
|
||||
Period (ms): 50
|
||||
Enabled : no
|
||||
|
||||
Events
|
||||
Timer Event
|
||||
swipex=tch0
|
||||
swipey=tch1
|
||||
|
||||
TouchCap swipe
|
||||
Attributes
|
||||
ID : 7
|
||||
Scope: local
|
||||
Value: 0
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
swipestore.en=1 // Start swipestore timer
|
||||
|
||||
Touch Release Event
|
||||
swipestore.en=0
|
||||
// Touch has ended, x
|
||||
if(tch0==0)
|
||||
{
|
||||
swipec=swipex-tch2
|
||||
// From Left to Right
|
||||
if(swipec>swipedx)
|
||||
{
|
||||
//page
|
||||
}
|
||||
// Right to Left
|
||||
swipec2=0-swipedx
|
||||
if(swipec<swipec2)
|
||||
{
|
||||
//page
|
||||
}
|
||||
}
|
||||
// Touch has ended, y
|
||||
if(tch1==0)
|
||||
{
|
||||
swipec=swipey-tch3
|
||||
// From Up to Down
|
||||
if(swipec>100)
|
||||
{
|
||||
//page
|
||||
}
|
||||
// Down to Up
|
||||
swipec2=0-swipedy
|
||||
if(swipec<-100)
|
||||
{
|
||||
//page
|
||||
}
|
||||
}
|
||||
|
||||
692
nspanel_us_code/light.txt
Normal file
692
nspanel_us_code/light.txt
Normal file
@@ -0,0 +1,692 @@
|
||||
Page light
|
||||
Attributes
|
||||
ID : 0
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Locked : no
|
||||
Swide up page ID : disabled
|
||||
Swide down page ID : disabled
|
||||
Swide left page ID : disabled
|
||||
Swide right page ID: disabled
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=home.brightness.val
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"currentpage\", \"value\": \"pagechange\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
vis light_b_press,1
|
||||
vis lightslider,1
|
||||
vis light_value,1
|
||||
vis temp_value_2,1
|
||||
// #### OFF Button #####
|
||||
vis temp_b_press,0
|
||||
vis color_b_pres,0
|
||||
// #### OFF Value #####
|
||||
vis temp_value,0
|
||||
vis light_value_2,0
|
||||
// #### OFF Slider #####
|
||||
vis tempslider,0
|
||||
vis colorwheel,0
|
||||
|
||||
Touch Press Event
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"touchevent\", \"value\": \"press\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "touchevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Touch Release Event
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"touchevent\", \"value\": \"release\", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "touchevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Variable (int32) rgb565
|
||||
Attributes
|
||||
ID : 22
|
||||
Scope: local
|
||||
Value: 0
|
||||
|
||||
Variable (string) va1
|
||||
Attributes
|
||||
ID : 23
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 20
|
||||
|
||||
Variable (string) va2
|
||||
Attributes
|
||||
ID : 24
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 10
|
||||
|
||||
Variable (string) va3
|
||||
Attributes
|
||||
ID : 25
|
||||
Scope : local
|
||||
Text : newtxt
|
||||
Max. Text Size: 10
|
||||
|
||||
Variable (int32) currenttab
|
||||
Attributes
|
||||
ID : 26
|
||||
Scope: local
|
||||
Value: 0
|
||||
|
||||
Variable (string) lightsetting
|
||||
Attributes
|
||||
ID : 32
|
||||
Scope : local
|
||||
Text :
|
||||
Max. Text Size: 255
|
||||
|
||||
Variable (string) entity
|
||||
Attributes
|
||||
ID : 33
|
||||
Scope : global
|
||||
Text :
|
||||
Max. Text Size: 100
|
||||
|
||||
Variable (string) back_page
|
||||
Attributes
|
||||
ID : 34
|
||||
Scope : local
|
||||
Text : home
|
||||
Max. Text Size: 15
|
||||
|
||||
Number ring
|
||||
Attributes
|
||||
ID : 4
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Value : 0
|
||||
|
||||
Number field
|
||||
Attributes
|
||||
ID : 5
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Value : 0
|
||||
|
||||
Text light_value
|
||||
Attributes
|
||||
ID : 1
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Text page_label
|
||||
Attributes
|
||||
ID : 2
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 25
|
||||
|
||||
Text temp_value
|
||||
Attributes
|
||||
ID : 14
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Text light_value_2
|
||||
Attributes
|
||||
ID : 27
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Text temp_value_2
|
||||
Attributes
|
||||
ID : 28
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Text icon_state
|
||||
Attributes
|
||||
ID : 31
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID : disabled
|
||||
Associated Keyboard: none
|
||||
Text :
|
||||
Max. Text Size : 10
|
||||
|
||||
Picture light_button
|
||||
Attributes
|
||||
ID : 8
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Picture color_button
|
||||
Attributes
|
||||
ID : 9
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Picture temp_button
|
||||
Attributes
|
||||
ID : 10
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Picture light_b_press
|
||||
Attributes
|
||||
ID : 11
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Picture temp_b_press
|
||||
Attributes
|
||||
ID : 12
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Picture color_b_pres
|
||||
Attributes
|
||||
ID : 13
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Picture colorwheel
|
||||
Attributes
|
||||
ID : 16
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
// Circular Color Picker for Nextion (c) Max Zuidberg 2022
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
//
|
||||
// Put this code in the touch press or release
|
||||
// event of the pic component with the color wheel.
|
||||
// Requires the two variables field.val and ring.val
|
||||
//
|
||||
// sya0 = x, sya1 = sya1
|
||||
// Note the usage of the hidden sya0, sya1 variables
|
||||
// within event code as local, temporary variable is fine.
|
||||
sya0=tch0
|
||||
sya1=tch1
|
||||
//
|
||||
// Convert absolute coordinates to coordinates relative to
|
||||
// the color wheel center.
|
||||
// sys0 = x_center, sys1 = y_center
|
||||
sys0=colorwheel.w/2
|
||||
sys0+=colorwheel.x
|
||||
sys1=colorwheel.h/2
|
||||
sys1+=colorwheel.y
|
||||
sya0-=sys0
|
||||
sya1-=sys1
|
||||
//
|
||||
// Determine ring
|
||||
ring.val=0
|
||||
// sys0 = r^2 = x^2 + y^2
|
||||
sys0=sya0*sya0
|
||||
sys1=sya1*sya1
|
||||
sys0+=sys1
|
||||
// repeat for all rings
|
||||
if(sys0>=156)
|
||||
{
|
||||
ring.val++
|
||||
}
|
||||
if(sys0>=625)
|
||||
{
|
||||
ring.val++
|
||||
}
|
||||
if(sys0>=1406)
|
||||
{
|
||||
ring.val++
|
||||
}
|
||||
if(sys0>=2500)
|
||||
{
|
||||
ring.val++
|
||||
}
|
||||
if(sys0>=3906)
|
||||
{
|
||||
ring.val++
|
||||
}
|
||||
if(sys0>=5625)
|
||||
{
|
||||
ring.val++
|
||||
}
|
||||
if(sys0>=7656)
|
||||
{
|
||||
ring.val++
|
||||
}
|
||||
//
|
||||
// Determine quadrant (0-3). Note: pixel y coords are inverted
|
||||
// compared to mathematical y coords. But we want math. quadrants.
|
||||
sya1*=-1
|
||||
sys2=0
|
||||
if(sya1<0)
|
||||
{
|
||||
sys2+=2
|
||||
}
|
||||
sys0=sya0*sya1
|
||||
if(sys0<0)
|
||||
{
|
||||
sys2+=1
|
||||
// In this case we also want to swap x and y otherwise the
|
||||
// atan(abs(x/y)) (calculated below) gives values running
|
||||
// "the wrong way" (cw instead of ccw).
|
||||
sys1=sya1
|
||||
sya1=sya0
|
||||
sya0=sys1
|
||||
}
|
||||
//
|
||||
field.val=sys2*6
|
||||
//
|
||||
// x,y sign is not required anymore
|
||||
if(sya0<0)
|
||||
{
|
||||
sya0*=-1
|
||||
}
|
||||
if(sya1<0)
|
||||
{
|
||||
sya1*=-1
|
||||
}
|
||||
//
|
||||
// Determine field in ring quadrant
|
||||
// Factor 100000 chosen more or less arbitrarily.
|
||||
// sys0 = 100000 * tan_a = 100000 * y / x
|
||||
sys0=100000*sya1
|
||||
sys0/=sya0
|
||||
// repeat for all fields
|
||||
if(sys0>=26794)
|
||||
{
|
||||
field.val++
|
||||
}
|
||||
if(sys0>=57735)
|
||||
{
|
||||
field.val++
|
||||
}
|
||||
if(sys0>=99999)
|
||||
{
|
||||
field.val++
|
||||
}
|
||||
if(sys0>=173205)
|
||||
{
|
||||
field.val++
|
||||
}
|
||||
if(sys0>=373205)
|
||||
{
|
||||
field.val++
|
||||
}
|
||||
covx r,va1.txt,0,0
|
||||
covx g,va2.txt,0,0
|
||||
covx b,va3.txt,0,0
|
||||
va1.txt=""
|
||||
va2.txt=""
|
||||
va3.txt=""
|
||||
|
||||
Touch Release Event
|
||||
// Adjust field.val "orientation" and offset to match the h value of the colors in the wheel
|
||||
h=23-field.val// 0 <= field.val <= 23
|
||||
// h is expected to be 0-6*256 (see hsv2rgb)
|
||||
h*=6*256
|
||||
h/=24// Number of fields
|
||||
//
|
||||
// s is expected to be 0-256 (see hsv2rgb)
|
||||
s=ring.val*256
|
||||
s/=8// Number of rings
|
||||
// no "value" selectable; fix it to the maximum (matching the colors in the wheels shown.
|
||||
v=255
|
||||
click hsv2rgb,0
|
||||
click rgb888to565,0
|
||||
//colPreview.bco=rgb565.val
|
||||
covx r,va1.txt,0,0
|
||||
covx g,va2.txt,0,0
|
||||
covx b,va3.txt,0,0
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"rgb_color\", \"value\": ["+va1.txt+","+va2.txt+","+va3.txt+"], \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
va1.txt=""
|
||||
va2.txt=""
|
||||
va3.txt=""
|
||||
|
||||
Picture light_exit
|
||||
Attributes
|
||||
ID : 29
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Slider lightslider
|
||||
Attributes
|
||||
ID : 3
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
Position : 0
|
||||
Upper range limit: 100
|
||||
Lower range limit: 0
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
covx lightslider.val,va1.txt,0,0
|
||||
light_value.txt=va1.txt+"%"
|
||||
light_value_2.txt=va1.txt+"%"
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"brightness_pct\", \"value\": "+va1.txt+", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Slider tempslider
|
||||
Attributes
|
||||
ID : 15
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
Position : 0
|
||||
Upper range limit: 500
|
||||
Lower range limit: 153
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
covx tempslider.val,va1.txt,0,0
|
||||
temp_value.txt=va1.txt
|
||||
temp_value_2.txt=va1.txt
|
||||
lightsetting.txt="{\"page\": \"light\", \"component\": \"color_temp\", \"value\": "+va1.txt+", \"entity\": \""+entity.txt+"\"}"
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
prints lightsetting.txt,0
|
||||
printh 00
|
||||
printh FF FF FF
|
||||
|
||||
Hotspot hsv2rgb
|
||||
Attributes
|
||||
ID : 6
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
// https://de.wikipedia.org/wiki/HSV-Farbraum#Umrechnung_HSV_in_RGB
|
||||
// The values range from 0..255 instead of 0..1
|
||||
// h ranges from 0..(6*256)
|
||||
if(s>=256)
|
||||
{
|
||||
s=255
|
||||
}else if(s<0)
|
||||
{
|
||||
s=0
|
||||
}
|
||||
if(v>=256)
|
||||
{
|
||||
v=255
|
||||
}else if(v<0)
|
||||
{
|
||||
v=0
|
||||
}
|
||||
f=h&0xff
|
||||
p=256-s
|
||||
p*=v
|
||||
p=p>>8// / 256
|
||||
q=s*f// 0-256*256 = 0-65536
|
||||
q=65536-q
|
||||
q*=v
|
||||
q=q>>16
|
||||
t=256-f
|
||||
t*=s
|
||||
t=65536-t
|
||||
t*=v
|
||||
t=t>>16
|
||||
//
|
||||
f=h>>8
|
||||
if(f==1)
|
||||
{
|
||||
r=q
|
||||
g=v
|
||||
b=p
|
||||
}else if(f==2)
|
||||
{
|
||||
r=p
|
||||
g=v
|
||||
b=t
|
||||
}else if(f==3)
|
||||
{
|
||||
r=p
|
||||
g=q
|
||||
b=v
|
||||
}else if(f==4)
|
||||
{
|
||||
r=t
|
||||
g=p
|
||||
b=v
|
||||
}else if(f==5)
|
||||
{
|
||||
r=v
|
||||
g=p
|
||||
b=q
|
||||
}else
|
||||
{
|
||||
r=v
|
||||
g=t
|
||||
b=p
|
||||
}
|
||||
|
||||
Hotspot rgb888to565
|
||||
Attributes
|
||||
ID : 7
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Release Event
|
||||
r=r&0xff
|
||||
g=g&0xff
|
||||
b=b&0xff
|
||||
sys1=r>>3
|
||||
sys2=sys1<<6
|
||||
sys1=g>>2
|
||||
sys2+=sys1
|
||||
sys2=sys2<<5
|
||||
sys1=b>>3
|
||||
sys2+=sys1
|
||||
rgb565.val=sys2
|
||||
|
||||
Hotspot light_touch
|
||||
Attributes
|
||||
ID : 17
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
vis light_b_press,1
|
||||
vis lightslider,1
|
||||
vis light_value,1
|
||||
vis temp_value_2,1
|
||||
// #### OFF Button #####
|
||||
vis temp_b_press,0
|
||||
vis color_b_pres,0
|
||||
// #### OFF Value #####
|
||||
vis temp_value,0
|
||||
vis light_value_2,0
|
||||
// #### OFF Slider #####
|
||||
vis tempslider,0
|
||||
vis colorwheel,0
|
||||
|
||||
Hotspot temp_touch
|
||||
Attributes
|
||||
ID : 18
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
vis temp_b_press,1
|
||||
vis tempslider,1
|
||||
vis temp_value,1
|
||||
vis light_value_2,1
|
||||
// #### OFF Button #####
|
||||
vis light_b_press,0
|
||||
vis color_b_pres,0
|
||||
// #### OFF Value #####
|
||||
vis light_value,0
|
||||
vis temp_value_2,0
|
||||
// #### OFF Slider #####
|
||||
vis lightslider,0
|
||||
vis colorwheel,0
|
||||
|
||||
Hotspot color_touch
|
||||
Attributes
|
||||
ID : 19
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
vis color_b_pres,1
|
||||
vis colorwheel,1
|
||||
vis light_value_2,1
|
||||
// #### OFF Button #####
|
||||
vis light_b_press,0
|
||||
vis temp_b_press,0
|
||||
// #### OFF Value #####
|
||||
vis light_value,0
|
||||
vis temp_value,0
|
||||
vis temp_value_2,0
|
||||
// #### OFF Slider #####
|
||||
vis lightslider,0
|
||||
vis tempslider,0
|
||||
// #### OFF Color #####
|
||||
|
||||
Hotspot light_back
|
||||
Attributes
|
||||
ID : 30
|
||||
Scope : local
|
||||
Dragging : 0
|
||||
Send Component ID: disabled
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
if(back_page.txt=="buttonpage01")
|
||||
{
|
||||
page buttonpage01
|
||||
}else if(back_page.txt=="buttonpage02")
|
||||
{
|
||||
page buttonpage02
|
||||
}else if(back_page.txt=="buttonpage03")
|
||||
{
|
||||
page buttonpage03
|
||||
}else if(back_page.txt=="buttonpage04")
|
||||
{
|
||||
page buttonpage04
|
||||
}else
|
||||
{
|
||||
page home
|
||||
}
|
||||
|
||||
Timer swipestore
|
||||
Attributes
|
||||
ID : 21
|
||||
Scope : local
|
||||
Period (ms): 50
|
||||
Enabled : no
|
||||
|
||||
Events
|
||||
Timer Event
|
||||
swipex=tch0
|
||||
swipey=tch1
|
||||
|
||||
TouchCap swipe
|
||||
Attributes
|
||||
ID : 20
|
||||
Scope: local
|
||||
Value: 0
|
||||
|
||||
Events
|
||||
Touch Press Event
|
||||
swipestore.en=1 // Start swipestore timer
|
||||
|
||||
Touch Release Event
|
||||
swipestore.en=0
|
||||
// Touch has ended, x
|
||||
if(tch0==0)
|
||||
{
|
||||
swipec=swipex-tch2
|
||||
// From Left to Right
|
||||
if(swipec>swipedx)
|
||||
{
|
||||
//page
|
||||
}
|
||||
// Right to Left
|
||||
swipec2=0-swipedx
|
||||
if(swipec<swipec2)
|
||||
{
|
||||
//page
|
||||
}
|
||||
}
|
||||
// Touch has ended, y
|
||||
if(tch1==0)
|
||||
{
|
||||
swipec=swipey-tch3
|
||||
// From Up to Down
|
||||
if(swipec>100)
|
||||
{
|
||||
//page
|
||||
}
|
||||
// Down to Up
|
||||
swipec2=0-swipedy
|
||||
if(swipec<-100)
|
||||
{
|
||||
//page
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ Page settings
|
||||
|
||||
Events
|
||||
Preinitialize Event
|
||||
dim=home.brightness.val
|
||||
printh 92
|
||||
prints "nspanelevent",0
|
||||
printh 00
|
||||
|
||||
Reference in New Issue
Block a user