Add a card for blinds and curtains, and fix what Studio 1 showed after 0.2.57 (0.2.58)
A tap on a cover now opens a card like Home Assistant's own, in the style of the climate and vacuum cards: a tall position slider on which the blind hangs from the top, a tilt slider over slats for venetian blinds, and open, stop and close keys. The key of the direction the cover moves is filled; a key that cannot move it further is disabled and stays out of the keys the card's tick enables. Sliders show their value while dragged and send it on release. The card offers only what supported_features allows. A battery-powered blind shows its battery at the top right: the app sends the device's battery sensor as the extra the vacuum card uses, and adds current_tilt_position to the attributes. Checking Studio 1 after its update to firmware 0.2.49 found that a setting number equal to its initial state 0 (night brightness 0 %) was never published, so Home Assistant kept it unknown and ESP Screens could not change it; apply_screen_settings now publishes a number without a state. The app also took "unavailable" for the device name during the restart and wrote sensor.esp_screens_unavailable; diagnostics ignore unknown and unavailable. The editor redraws its tiles, top bar and entity list when the live stream opened a screen before the first full inventory (a busy add-on), and loads app.js and style.css by content stamp after Safari kept an old script. Checked with 254 Python and 14 C++ tests, generate_packages --check, ESP32 builds of both profiles, and 20 API checks of the card on host builds of both boards. Firmware 0.2.50. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -106,7 +106,8 @@ def fake_ha(firmware=FIRMWARE_VERSION, owned=True, guition=True):
|
||||
class CoreSettings(unittest.TestCase):
|
||||
def test_every_setting_the_editor_offers_has_an_entity(self):
|
||||
self.assertEqual(set(SETTING_ENTITIES), set(SETTING_RULES) - {'show_clock'})
|
||||
self.assertEqual(SETTING_ENTITIES_MIN_FIRMWARE, FIRMWARE_VERSION)
|
||||
self.assertEqual(SETTING_ENTITIES_MIN_FIRMWARE, '0.2.49')
|
||||
self.assertLessEqual(tuple(map(int, SETTING_ENTITIES_MIN_FIRMWARE.split('.'))), tuple(map(int, FIRMWARE_VERSION.split('.'))))
|
||||
|
||||
def test_the_entities_are_named_as_in_both_board_profiles(self):
|
||||
blocks = {'switch': 'switch', 'number': 'number', 'time': 'datetime', 'select': 'select'}
|
||||
@@ -581,7 +582,9 @@ class Firmware(unittest.TestCase):
|
||||
script = script[:script.index('\n - id: ', 10)]
|
||||
for entity in ('setting_brightness', 'setting_standby_brightness', 'setting_night_brightness', 'setting_standby_seconds',
|
||||
'setting_auto_home_seconds'):
|
||||
self.assertIn(f'id({entity}).publish_state(', script, f'{path.name}: {entity}')
|
||||
# One loop publishes every number that lacks a state or changed (firmware 0.2.50, see test_cover_card).
|
||||
self.assertIn(f'std::make_pair(id({entity}),', script, f'{path.name}: {entity}')
|
||||
self.assertIn('if (!entity->has_state() || entity->state != value) entity->publish_state(value);', script, path.name)
|
||||
self.assertIn('std::make_pair(id(setting_night_start), settings.night_start)', script, path.name)
|
||||
self.assertIn('settings_screen::refresh();', script, f'{path.name}: an open settings page follows Home Assistant')
|
||||
self.assertEqual('id(setting_rotation)->update();' in script, board == 'guition', path.name)
|
||||
|
||||
Reference in New Issue
Block a user