Calendar analog clock with ticks and numerals; tiles without background
Firmware 0.2.16: the analog clock uses index strokes with 12/3/6/9 numerals on large cards and shows a calendar block (weekday, big day, short month) beside the dial on single tiles; wide cards keep the digital time and date. New palette key 'none' hides only the card fill and border: geometry, padding and the pressed flash stay identical. Skeleton frames and the render self-test honour the transparency. App 0.2.15: 'Geen' in the background palette with a dashed mockup tile, min_firmware 0.2.16 for such layouts, demo layout with the bare calendar clock (--wide for the double-width clock). README and AGENTS note that every push is a release and bumps the add-on version. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
@@ -18,7 +18,7 @@ from core import extras, packets, state_message, validate_layout # noqa: E402
|
||||
|
||||
def demo_layout():
|
||||
return validate_layout({'title': 'Demo kaarten', 'tiles': [
|
||||
{'entity': 'screen.clock', 'name': '', 'options': {'display': 'analog', 'size': 'wide'}},
|
||||
{'entity': 'screen.clock', 'name': '', 'options': {'display': 'analog', 'background': 'none'}},
|
||||
{'entity': 'weather.demo', 'name': 'Buiten', 'options': {'display': 'forecast'}},
|
||||
{'entity': 'sensor.demo_temperatuur', 'name': 'Woonkamer', 'options': {'display': 'graph'}},
|
||||
{'entity': 'person.demo', 'name': 'Max', 'options': {}},
|
||||
@@ -47,11 +47,13 @@ def demo_forecast(now):
|
||||
return [{'datetime': (now + timedelta(days=i)).isoformat(), 'condition': conditions[i], 'temperature': 21 - i, 'templow': 11 + i}
|
||||
for i in range(6)]
|
||||
|
||||
def messages(inbox, rotate=0, digital=False):
|
||||
def messages(inbox, rotate=0, digital=False, wide=False):
|
||||
now = datetime.now(timezone.utc)
|
||||
layout, states = demo_layout(), demo_states(now)
|
||||
if digital:
|
||||
layout['tiles'][0]['options'] = {'display': 'digital'}
|
||||
elif wide:
|
||||
layout['tiles'][0]['options'] = {'display': 'analog', 'size': 'wide'}
|
||||
layout['tiles'] = layout['tiles'][rotate:] + layout['tiles'][:rotate]
|
||||
out = [{'v': 1, 'op': 'layout', 'inbox': inbox, 'title': layout['title'], 'entities': [t['entity'] for t in layout['tiles']]}]
|
||||
for i, tile in enumerate(layout['tiles']):
|
||||
@@ -68,7 +70,8 @@ async def main():
|
||||
p.add_argument('--name', required=True, help='Verwachte DEVICE_NAME')
|
||||
p.add_argument('--secrets', type=Path, default=Path(__file__).resolve().parents[1] / 'secrets.yaml')
|
||||
p.add_argument('--rotate', type=int, default=0, help='Zet tegel N vooraan, zodat latere pagina\'s op pagina 1 komen')
|
||||
p.add_argument('--digital', action='store_true', help='Digitale klok op een enkele tegel in plaats van analoog dubbelbreed')
|
||||
p.add_argument('--digital', action='store_true', help='Digitale klok op een enkele tegel in plaats van de analoge kalenderkaart zonder achtergrond')
|
||||
p.add_argument('--wide', action='store_true', help='Analoge klok dubbelbreed (wijzerplaat met digitale tijd en datum)')
|
||||
args = p.parse_args()
|
||||
client = APIClient(args.host, 6053, noise_psk=yaml.safe_load(args.secrets.read_text())['api_encryption_key'],
|
||||
client_info='Demo layout', expected_name=args.name)
|
||||
@@ -83,7 +86,7 @@ async def main():
|
||||
replies.append(update.state)
|
||||
client.subscribe_states(state)
|
||||
started = time.monotonic()
|
||||
for message in messages(inbox.object_id if hasattr(inbox, 'object_id') else 'text.inbox', args.rotate % 9, args.digital):
|
||||
for message in messages(inbox.object_id if hasattr(inbox, 'object_id') else 'text.inbox', args.rotate % 9, args.digital, args.wide):
|
||||
for packet in packets(message):
|
||||
client.text_command(inbox.key, packet)
|
||||
await asyncio.sleep(0.05)
|
||||
|
||||
Reference in New Issue
Block a user