Skip to content

Commit

Permalink
Prevents light icons to become totally white
Browse files Browse the repository at this point in the history
Solves #1567
  • Loading branch information
edwardtfn committed Feb 29, 2024
1 parent 87051d8 commit a3df5f9
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 26 deletions.
8 changes: 6 additions & 2 deletions esphome/nspanel_esphome_core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ esphome:
- priority: 600.0 # This is where most sensors are set up.
then:
- lambda: |-
blueprint_status->publish_state(0);
std::string s = "${device_name}";
std::string result;
bool last_was_underscore = false;
Expand Down Expand Up @@ -1400,7 +1401,11 @@ sensor:
internal: false
disabled_by_default: false
filters:
- lambda: return (x / 62) * 100.0f;
- lambda: |-
if (isnan(x) and x>0)
return (x / 62) * 100.0f;
else
return 0;
on_value:
then:
- lambda: |-
Expand Down Expand Up @@ -1530,7 +1535,6 @@ sensor:

##### START - SWITCH CONFIGURATION #####
switch:

##### Notification unread #####
- name: Notification unread
platform: template
Expand Down
51 changes: 27 additions & 24 deletions nspanel_blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7768,9 +7768,9 @@ action:
{% set entity_brightness_index = (entity_brightness | int(255))/255 if is_number(entity_brightness) else 1 %}
{{
[
min(255,entity_rgb_color[0] * entity_brightness_index) | round(0),
min(255,entity_rgb_color[1] * entity_brightness_index) | round(0),
min(255,entity_rgb_color[2] * entity_brightness_index) | round(0)
min(200,entity_rgb_color[0] * entity_brightness_index) | round(0),
min(200,entity_rgb_color[1] * entity_brightness_index) | round(0),
min(200,entity_rgb_color[2] * entity_brightness_index) | round(0)
]
}}
{% endif %}
Expand Down Expand Up @@ -7859,20 +7859,14 @@ action:
color_rgb: !input 'home_button05_icon_color'
title: !input 'qrcode_label'
qrcode: !input 'qrcode_value'

- variables:
display:
date:
format:
color_rgb: !input 'date_label_color'
time:
format: !input 'time_format'
color_rgb: !input 'time_label_color'

- variables:
screensaver_display_time: !input screensaver_display_time
screensaver_display_time_font_size: !input screensaver_display_time_font_size
screensaver_display_time_font_color: !input screensaver_display_time_font_color

- &variables_outdoor_temp
variables:
Expand Down Expand Up @@ -8032,9 +8026,9 @@ action:
ent_value_xcen: '{{ int(entitypages_value_alignment) if is_number(entitypages_value_alignment) else 0 }}'
mui_please_confirm: '{{ mui[language].please_confirm }}'
mui_unavailable: '{{ mui[language].unavailable }}'
screensaver_time: '{{ screensaver_display_time if screensaver_display_time is boolean else false }}'
screensaver_time: !input screensaver_display_time
screensaver_time_font: '{{ int(screensaver_display_time_font_size) }}'
screensaver_time_color: '{{ screensaver_display_time_font_color if screensaver_display_time_font_color is sequence else [64, 64, 64] }}'
screensaver_time_color: !input screensaver_display_time_font_color
decimal_separator: !input decimal_separator
continue_on_error: true

Expand All @@ -8047,12 +8041,13 @@ action:
is_{{ repeat.item }}={{
1
if
buttons_pages.buttons |
selectattr("page", "defined") |
selectattr("page", "eq", repeat.item) |
selectattr("entity", "defined") |
list |
count > 0
buttons_pages.buttons
| selectattr("page", "defined")
| selectattr("page", "eq", repeat.item)
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
| count > 0
else 0
}}
continue_on_error: true
Expand All @@ -8066,12 +8061,13 @@ action:
is_{{ repeat.item }}={{
1
if
entities_pages.entities |
selectattr("page", "defined") |
selectattr("page", "eq", repeat.item) |
selectattr("entity", "defined") |
list |
count > 0
entities_pages.entities
| selectattr("page", "defined")
| selectattr("page", "eq", repeat.item)
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
| count > 0
else 0
}}
continue_on_error: true
Expand Down Expand Up @@ -8320,6 +8316,7 @@ action:
{{
home_page_custom_buttons
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
}}
sequence:
Expand Down Expand Up @@ -8406,6 +8403,7 @@ action:
{{
home_page_status_bar
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
}}
sequence:
Expand Down Expand Up @@ -8485,6 +8483,7 @@ action:
{{
home_page_values
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
}}
sequence:
Expand Down Expand Up @@ -8581,6 +8580,7 @@ action:
| selectattr("page", "defined")
| selectattr("page", "eq", event_page)
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
}}
sequence: &display_button_page_button
Expand Down Expand Up @@ -9140,6 +9140,7 @@ action:
{{
climate_page_entities
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
}}
sequence: *display_value
Expand Down Expand Up @@ -9250,7 +9251,7 @@ action:
component: button09
- &climate-update_custom_buttons-update
repeat:
for_each: '{{ climate_custom_buttons | selectattr("entity", "defined") | list }}'
for_each: '{{ climate_custom_buttons | selectattr("entity", "defined") | rejectattr("entity", "eq", []) | list }}'
sequence:
- condition: '{{ repeat.item.entity is defined and repeat.item.entity is string and repeat.item.entity | length > 0 }}'
- variables:
Expand Down Expand Up @@ -9301,6 +9302,7 @@ action:
| selectattr("page", "defined")
| selectattr("page", "eq", event_page)
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
}}
sequence: &update_entity_page_entity
Expand Down Expand Up @@ -9922,6 +9924,7 @@ action:
| selectattr("component", "defined")
| selectattr("component", "eq", nspanel_event.component)
| selectattr("entity", "defined")
| rejectattr("entity", "eq", [])
| list
}}
- condition: '{{ last_click_button | count >= 0 }}'
Expand Down
5 changes: 5 additions & 0 deletions prebuilt/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Gitignore settings for ESPHome
# This is an example and may include too much for your use-case.
# You can modify this file to suit your needs.
/.esphome/
/secrets.yaml

0 comments on commit a3df5f9

Please sign in to comment.