Let the page buttons make way: a Page buttons setting that gives their room to the tiles, chevrons and dots instead of words, and a warning in the editor for pages nothing leads to (0.2.82)
GitHub issue #9 asked to drop the Previous/Next bar when Go to page tiles do the navigation and to give the tiles the whole screen. Page buttons is a setting the screen owns (on by default): a row in the Screen group of the settings page, switch.<screen>_page_buttons in Home Assistant, and a row in the editor's Screen settings. Without the bar, and on a screen with one page, place_page moves and sizes the three rows so they reach the bottom margin (Guition 108 -> 122 px, CYD 52 -> 61 px); a card keeps its circle, name and state in its middle and the single analog clock keeps its dial. With page buttons and swiping both off, the editor says where the Go to page tiles lead and which pages that leaves out of reach. The bar itself: each half of the band under the tiles is one key with an MDI chevron and lights up under a finger, and a dot per page sits between them; the screen's settings page uses the same pager. App 0.2.82, firmware 0.2.69. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,7 +16,7 @@ from core import (ALERT_CAMERA_FIELD, ALERT_ENDINGS, ALERT_EVENT, ALERT_FALLBACK
|
||||
ALERT_MIN_FIRMWARE, ALERT_SUGGESTED_ICONS, AUTO_STANDBY_MIN_FIRMWARE, BROADCAST_DISMISS, BROADCAST_SHOW,
|
||||
CONTROLS, DISPLAYS, FULL_PAGE_MIN_FIRMWARE, MAX_PAGES, MAX_SLOTS, MAX_TILES, PAGE_TILE_REPEAT_MIN_FIRMWARE,
|
||||
SETTINGS_PAGE_MIN_FIRMWARE, SLOTS_PER_PAGE, TILE_BACKGROUNDS, TILE_EVENTS, TILE_RESULT_EVENT, WAKE_SLEEP_MIN_FIRMWARE,
|
||||
SETTING_ENTITIES_MIN_FIRMWARE, DARK_MODE_MIN_FIRMWARE)
|
||||
SETTING_ENTITIES_MIN_FIRMWARE, DARK_MODE_MIN_FIRMWARE, PAGE_BUTTONS_MIN_FIRMWARE)
|
||||
# Full-page tiles, navigation tiles and forty-eight tiles per screen.
|
||||
FULL_PAGE_VERSION = '.'.join(str(part) for part in FULL_PAGE_MIN_FIRMWARE)
|
||||
# The same navigation tile on several pages (app 0.2.78).
|
||||
@@ -286,6 +286,7 @@ Every screen has these entities in Home Assistant, on its ESPHome device. `<scre
|
||||
| `switch.<screen>_back_to_page_1` | On: after `number.<screen>_back_to_page_1_after` seconds without a touch (30 to 3600) the screen closes a card and goes back to page 1. Pressing Wake, an alert or Auto standby don't count as a touch. |
|
||||
| `switch.<screen>_back_to_page_1_on_standby` | On: going into standby also goes back to page 1. |
|
||||
| `switch.<screen>_swipe_between_pages` | On: swipe between pages. |
|
||||
| `switch.<screen>_page_buttons` | On: the Previous and Next bar under the tiles on a screen with more than one page. Off: no bar, the tiles take its room, and only swiping or Go to page tiles change the page. Firmware {PAGE_BUTTONS_MIN_FIRMWARE} or newer. |
|
||||
| `select.<screen>_rotation` | Guition only: `0°`, `90°`, `180°` or `270°`. |
|
||||
|
||||
Wake and Sleep are buttons: press them with the `button.press` action. They save nothing, so an automation may press them as often as it likes, on every motion too. To reach several screens at once, list their buttons under `entity_id`. Don't target an area or a device with `button.press`: that presses every other button there as well, the Wake and Sleep of the same screen included.
|
||||
|
||||
@@ -37,7 +37,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.68'
|
||||
FIRMWARE_VERSION = '0.2.69'
|
||||
# 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.
|
||||
@@ -48,6 +48,8 @@ WAKE_SLEEP_MIN_FIRMWARE = '0.2.45'
|
||||
SETTING_ENTITIES_MIN_FIRMWARE = '0.2.49'
|
||||
# Dark mode: the screen's dark look, a setting and entity of its own (components/smart_display/theme.h).
|
||||
DARK_MODE_MIN_FIRMWARE = '0.2.54'
|
||||
# Page buttons: the Previous and Next bar under the tiles, a setting and entity of its own; off, the tiles take its room.
|
||||
PAGE_BUTTONS_MIN_FIRMWARE = '0.2.69'
|
||||
ATTRS = frozenset('brightness percentage current_position current_tilt_position current_temperature temperature current_humidity min_temp max_temp target_temp_step supported_color_modes hvac_modes hvac_action hs_color color_temp_kelvin min_color_temp_kelvin max_color_temp_kelvin fan_speed_list unit_of_measurement battery_level fan_speed volume_level is_volume_muted media_title options min max step temperature_unit supported_features device_class next_rising next_setting finishes_at duration remaining humidity wind_speed wind_speed_unit apparent_temperature fan_modes swing_modes fan_mode swing_mode'.split())
|
||||
# Attributes whose boolean value the screen needs; every other bool stays behind.
|
||||
BOOL_ATTRS = frozenset(['is_volume_muted'])
|
||||
@@ -276,12 +278,15 @@ SETTING_RULES = {
|
||||
# The dark look for a screen beside a bed (firmware 0.2.54+). Only a screen that owns its settings has it: it
|
||||
# never travels in the layout message.
|
||||
'dark_mode': (False, None, None),
|
||||
# The Previous and Next bar under the tiles (firmware 0.2.69+); off, the tiles grow into its room. Only a screen
|
||||
# that owns its settings has it, like dark_mode.
|
||||
'page_buttons': (True, None, None),
|
||||
}
|
||||
# Firmware before 0.2.44 accepts a `settings` object with exactly its own eleven keys and refuses any
|
||||
# other size, so everything added after it travels as its own key in the layout message. Old firmware
|
||||
# ignores a key it does not know; a new screen with an old add-on keeps what it saved itself.
|
||||
# docs/SETTINGS.md walks through adding one.
|
||||
SETTINGS_BESIDE_BLOCK = ('swipe_pages', 'rotation', 'auto_home', 'auto_home_seconds', 'dark_mode')
|
||||
SETTINGS_BESIDE_BLOCK = ('swipe_pages', 'rotation', 'auto_home', 'auto_home_seconds', 'dark_mode', 'page_buttons')
|
||||
|
||||
# ----- The screen owns its settings (firmware 0.2.49+) -----
|
||||
# A screen offers every setting as an entity of its own device, and the settings page on the screen, Home
|
||||
@@ -306,6 +311,7 @@ SETTING_ENTITIES = {
|
||||
'swipe_pages': ('switch', 'Swipe between pages'),
|
||||
'rotation': ('select', 'Rotation'),
|
||||
'dark_mode': ('switch', 'Dark mode'),
|
||||
'page_buttons': ('switch', 'Page buttons'),
|
||||
}
|
||||
# Entities firmware 0.2.49 added; one of them on a device means the screen owns its settings. The first five
|
||||
# existed before, so they cannot tell.
|
||||
|
||||
@@ -699,8 +699,9 @@ class Manager:
|
||||
values = validate_settings({})
|
||||
if (self.firmware_version(inbox, screen) or (0, 0, 0)) < (0, 2, 44):
|
||||
keys = [key for key in keys if key not in ('auto_home', 'auto_home_seconds')]
|
||||
# Dark mode came after the screens took over their settings: firmware that gets them with the layout lacks it.
|
||||
keys = [key for key in keys if key != 'dark_mode']
|
||||
# Dark mode and the page buttons came after the screens took over their settings: firmware that gets them
|
||||
# with the layout lacks them.
|
||||
keys = [key for key in keys if key not in ('dark_mode', 'page_buttons')]
|
||||
return {'owner': 'layout', 'values': values, 'keys': keys, 'unavailable': []}
|
||||
# Only the settings this screen has an entity for: one added in later firmware stays out of the panel.
|
||||
keys = [key for key in keys if key in entities]
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -5,8 +5,8 @@
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<meta name="color-scheme" content="light dark" />
|
||||
<title>ESP Screens</title>
|
||||
<script type="module" crossorigin src="./assets/index-Cp1JAouO.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-DUJYFAbE.css">
|
||||
<script type="module" crossorigin src="./assets/index-Cp13kZoB.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="./assets/index-CKR1N3aP.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
|
||||
Reference in New Issue
Block a user