strange-v / power-outage-schedule-card

Power outage schedule card for Home Assistant
MIT License
3 stars 1 forks source link

[Feature Request] Add support for the `calendar` entity #1

Open andrewjswan opened 2 weeks ago

andrewjswan commented 2 weeks ago

Add support for the calendar entity, with the ability to determine the state when the light will be off, possibly off, or there will be no shutdowns. Examples for calendars:

https://github.com/szheliab/dtek-blackout-schedule-calendars

type: custom:power-outage-schedule-card
calendar_entity: calendar.blackout_schedule
hide_past_hours: true
title: Power outage schedule
states:
  - off: Планове відключення
  - maybe: Можливо відключення

https://gitlab.com/m03geek/dtek-blackout-schedule/

type: custom:power-outage-schedule-card
calendar_entity: calendar.blackout_schedule
hide_past_hours: true
title: Power outage schedule
states:
  - on: no
  - off: yes
  - maybe: maybe
strange-v commented 2 weeks ago

I have no experience with the calendar entity, so I do not know whether retrieving all the needed information is possible (from the frontend component).

andrewjswan commented 2 weeks ago

You can try to look at maps that work with the weather, there is the same principle, first a function that receives a list of forecasts, then this list is displayed.

https://github.com/home-assistant/frontend/blob/dev/src/data/weather.ts

Or maybe this help https://github.com/totaldebug/atomic-calendar-revive/blob/2e6ea00e3455543fdad0a82a9a6a83fb03fb4e10/src/lib/event.func.ts#L146