Show binary sensors in Home Assistant's words and grey out what is off (0.2.62)
A binary sensor's tile and card now say what Home Assistant says for its device class, such as Open or Closed for a door and Wet or Dry for a leak sensor. The screen maps the class it already receives, with the same words as the top bar and the history card; a test keeps both tables equal. A history card still waiting for its answer no longer shows the previous card's word. Lights and binary sensors that are off turn grey, as in Home Assistant, and a light without an icon of its own shows a crossed-out bulb while it is off, on the tile and in the top bar. A chosen icon stays and turns grey. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
## 0.2.62 (firmware 0.2.53)
|
||||
|
||||
On or off at a glance, in Home Assistant's words and colours.
|
||||
|
||||
- **A door says Open or Closed.** A binary sensor's tile and card use the words of its kind, the same ones the top bar and the history card show: a door or window Open or Closed, motion Motion or No motion, a leak sensor Wet or Dry, and so on for smoke, battery, connectivity, plugs and the rest. A sensor without a kind still says On or Off.
|
||||
- **Off looks off.** A light or binary sensor that is off turns grey, as in Home Assistant, and a light without an icon of its own shows a crossed-out bulb while it is off, in the top bar too. An icon you chose stays the same and turns grey, as Home Assistant does with an icon of its own.
|
||||
- **The history card's heading is right while it loads.** It said On until the history arrived, and a card opened after another one could show that card's word for a moment, such as Open on a motion sensor.
|
||||
- Needs firmware 0.2.53: press **Update** on the screen. Older firmware keeps On, Off and its colours, and shows an off light in the top bar without an icon.
|
||||
|
||||
## 0.2.61 (firmware 0.2.52)
|
||||
|
||||
Your own YAML for one screen, kept through updates.
|
||||
|
||||
@@ -17,7 +17,7 @@ WEEKDAYS = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']
|
||||
REPO = 'https://github.com/MaxGramser/homeassistant_espscreen'
|
||||
REFS = {'cyd': 'main', 'guition': 'main'}
|
||||
# Firmware shipped with this app release; screens below it get an update offer.
|
||||
FIRMWARE_VERSION = '0.2.52'
|
||||
FIRMWARE_VERSION = '0.2.53'
|
||||
# The Auto standby switch a screen offers Home Assistant automations.
|
||||
AUTO_STANDBY_MIN_FIRMWARE = '0.2.41'
|
||||
# The settings page the screen opens itself, and the screen.settings tile that opens it.
|
||||
|
||||
@@ -38,7 +38,8 @@ STATES = {
|
||||
'armed_vacation': 'Armed vacation', 'armed_custom_bypass': 'Armed', 'arming': 'Arming', 'pending': 'Pending',
|
||||
'triggered': 'Triggered', 'active': 'Active', 'above_horizon': 'Up', 'below_horizon': 'Down',
|
||||
}
|
||||
# device_class: (on, off)
|
||||
# device_class: (on, off). Tiles and cards show the same words from the screen's own copy, BINARY_WORDS in
|
||||
# components/smart_display/tile_controls.h (firmware 0.2.53+); tests/test_binary_words.py keeps the two equal.
|
||||
BINARY_STATES = {
|
||||
'battery': ('Low', 'Normal'), 'battery_charging': ('Charging', 'Not charging'), 'carbon_monoxide': ('Danger', 'Safe'),
|
||||
'cold': ('Cold', 'Normal'), 'connectivity': ('Connected', 'Disconnected'), 'door': ('Open', 'Closed'),
|
||||
@@ -245,6 +246,8 @@ def auto_icon(entity, state):
|
||||
domain, device_class = entity.split('.')[0], attrs.get('device_class')
|
||||
if domain == 'weather':
|
||||
name = tile_icons.WEATHER.get(raw, 'weather-partly-cloudy')
|
||||
elif domain == 'light' and raw == 'off':
|
||||
name = 'lightbulb-off'
|
||||
elif domain == 'sun':
|
||||
name = 'weather-sunset-down' if raw == 'above_horizon' else 'weather-sunset-up'
|
||||
elif domain == 'binary_sensor' and device_class in BINARY_ICONS:
|
||||
|
||||
Binary file not shown.
@@ -224,6 +224,8 @@ FIXED = (
|
||||
('monitor', 'F0379'),
|
||||
('information-outline', 'F02FD'),
|
||||
('restart', 'F0709'),
|
||||
# A light that is off, as Home Assistant shows one without an icon of its own (firmware 0.2.53+).
|
||||
('lightbulb-off', 'F0E4F'),
|
||||
)
|
||||
|
||||
# Pickable icons by name, and every glyph the firmware fonts contain.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: ESP Screen Manager
|
||||
version: "0.2.61"
|
||||
version: "0.2.62"
|
||||
slug: esp_screen_manager
|
||||
description: Choose tiles for your CYD and Guition touchscreen, without reflashing.
|
||||
url: https://github.com/MaxGramser/homeassistant_espscreen
|
||||
|
||||
Reference in New Issue
Block a user