diff --git a/README.md b/README.md
index 06daa873..7cbaa818 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
[![Build Status](https://github.com/aneisch/home-assistant-config/actions/workflows/check-ha-release-compatibility.yml/badge.svg)](https://github.com/aneisch/home-assistant-config/actions)
[![GitHub last commit](https://img.shields.io/github/last-commit/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/commits/master)
[![GitHub commit activity](https://img.shields.io/github/commit-activity/y/aneisch/home-assistant-config)](https://github.com/aneisch/home-assistant-config/graphs/commit-activity)
-[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.3.1%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
+[![HA Version](https://img.shields.io/badge/Running%20Home%20Assistant-2024.3.3%20(Latest)-brightgreen)](https://github.com/home-assistant/home-assistant/releases/latest)
@@ -57,7 +57,7 @@ Also using Grafana/Influx for graphing, both running in Docker containers on NUC
Description | value
-- | --
Lines of ESPHome YAML | 2801
-Lines of Home Assistant YAML | 9201
+Lines of Home Assistant YAML | 9205
[Integrations](https://www.home-assistant.io/integrations/) in use | 58
Zigbee devices in [`zha`](https://www.home-assistant.io/integrations/zha/) | 26
Z-Wave devices in [`zwave_js`](https://www.home-assistant.io/integrations/zwave_js/) | 37
@@ -71,7 +71,7 @@ Entities in the [`camera`](https://www.home-assistant.io/components/camera) doma
Entities in the [`climate`](https://www.home-assistant.io/components/climate) domain | 1
Entities in the [`counter`](https://www.home-assistant.io/components/counter) domain | 1
Entities in the [`cover`](https://www.home-assistant.io/components/cover) domain | 13
-Entities in the [`device_tracker`](https://www.home-assistant.io/components/device_tracker) domain | 2
+Entities in the [`device_tracker`](https://www.home-assistant.io/components/device_tracker) domain | 4
Entities in the [`event`](https://www.home-assistant.io/components/event) domain | 50
Entities in the [`fan`](https://www.home-assistant.io/components/fan) domain | 3
Entities in the [`group`](https://www.home-assistant.io/components/group) domain | 17
@@ -91,17 +91,17 @@ Entities in the [`remote`](https://www.home-assistant.io/components/remote) doma
Entities in the [`scene`](https://www.home-assistant.io/components/scene) domain | 2
Entities in the [`script`](https://www.home-assistant.io/components/script) domain | 56
Entities in the [`select`](https://www.home-assistant.io/components/select) domain | 3
-Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 441
+Entities in the [`sensor`](https://www.home-assistant.io/components/sensor) domain | 442
Entities in the [`siren`](https://www.home-assistant.io/components/siren) domain | 1
Entities in the [`sun`](https://www.home-assistant.io/components/sun) domain | 1
-Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 160
+Entities in the [`switch`](https://www.home-assistant.io/components/switch) domain | 165
Entities in the [`timer`](https://www.home-assistant.io/components/timer) domain | 6
Entities in the [`tts`](https://www.home-assistant.io/components/tts) domain | 1
Entities in the [`update`](https://www.home-assistant.io/components/update) domain | 35
Entities in the [`vacuum`](https://www.home-assistant.io/components/vacuum) domain | 1
Entities in the [`weather`](https://www.home-assistant.io/components/weather) domain | 2
Entities in the [`zone`](https://www.home-assistant.io/components/zone) domain | 6
-**Total state objects** | **1280**
+**Total state objects** | **1288**
## The HACS integrations/plugins that I use:
**Appdaemon**:
[aneisch/follow_me_appdaemon](https://github.com/aneisch/follow_me_appdaemon)
diff --git a/custom_components/frigate/icons.py b/custom_components/frigate/icons.py
index 61675dee..e8a12807 100644
--- a/custom_components/frigate/icons.py
+++ b/custom_components/frigate/icons.py
@@ -19,6 +19,7 @@
ICON_PERSON = "mdi:human"
ICON_SERVER = "mdi:server"
ICON_SPEEDOMETER = "mdi:speedometer"
+ICON_WAVEFORM = "mdi:waveform"
ICON_DEFAULT_ON = "mdi:home"
diff --git a/custom_components/frigate/manifest.json b/custom_components/frigate/manifest.json
index 8105fdcb..466e5562 100644
--- a/custom_components/frigate/manifest.json
+++ b/custom_components/frigate/manifest.json
@@ -13,6 +13,6 @@
"documentation": "https://github.com/blakeblackshear/frigate",
"iot_class": "local_push",
"issue_tracker": "https://github.com/blakeblackshear/frigate-hass-integration/issues",
- "requirements": ["pytz==2022.7"],
- "version": "5.0.1"
+ "requirements": ["pytz"],
+ "version": "5.1.0"
}
diff --git a/custom_components/frigate/sensor.py b/custom_components/frigate/sensor.py
index 9bf3b963..6a20e1e2 100644
--- a/custom_components/frigate/sensor.py
+++ b/custom_components/frigate/sensor.py
@@ -5,7 +5,12 @@
from typing import Any
from homeassistant.config_entries import ConfigEntry
-from homeassistant.const import CONF_URL, PERCENTAGE, UnitOfTemperature
+from homeassistant.const import (
+ CONF_URL,
+ PERCENTAGE,
+ UnitOfSoundPressure,
+ UnitOfTemperature,
+)
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import DeviceInfo, EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -24,7 +29,13 @@
get_zones,
)
from .const import ATTR_CONFIG, ATTR_COORDINATOR, DOMAIN, FPS, MS, NAME
-from .icons import ICON_CORAL, ICON_SERVER, ICON_SPEEDOMETER, get_icon_from_type
+from .icons import (
+ ICON_CORAL,
+ ICON_SERVER,
+ ICON_SPEEDOMETER,
+ ICON_WAVEFORM,
+ get_icon_from_type,
+)
_LOGGER: logging.Logger = logging.getLogger(__name__)
@@ -75,6 +86,9 @@ async def async_setup_entry(
]
)
+ if frigate_config["cameras"][name]["audio"]["enabled_in_config"]:
+ entities.append(CameraSoundSensor(coordinator, entry, name))
+
frigate_config = hass.data[DOMAIN][entry.entry_id][ATTR_CONFIG]
entities.extend(
[
@@ -394,6 +408,78 @@ def icon(self) -> str:
return ICON_SPEEDOMETER
+class CameraSoundSensor(FrigateEntity, CoordinatorEntity): # type: ignore[misc]
+ """Frigate Camera Sound Level class."""
+
+ def __init__(
+ self,
+ coordinator: FrigateDataUpdateCoordinator,
+ config_entry: ConfigEntry,
+ cam_name: str,
+ ) -> None:
+ """Construct a CameraSoundSensor."""
+ FrigateEntity.__init__(self, config_entry)
+ CoordinatorEntity.__init__(self, coordinator)
+ self._cam_name = cam_name
+ self._attr_entity_registry_enabled_default = True
+
+ @property
+ def unique_id(self) -> str:
+ """Return a unique ID to use for this entity."""
+ return get_frigate_entity_unique_id(
+ self._config_entry.entry_id,
+ "sensor_sound_level",
+ f"{self._cam_name}_dB",
+ )
+
+ @property
+ def device_info(self) -> DeviceInfo:
+ """Get device information."""
+ return {
+ "identifiers": {
+ get_frigate_device_identifier(self._config_entry, self._cam_name)
+ },
+ "via_device": get_frigate_device_identifier(self._config_entry),
+ "name": get_friendly_name(self._cam_name),
+ "model": self._get_model(),
+ "configuration_url": f"{self._config_entry.data.get(CONF_URL)}/cameras/{self._cam_name}",
+ "manufacturer": NAME,
+ }
+
+ @property
+ def name(self) -> str:
+ """Return the name of the sensor."""
+ return "sound level"
+
+ @property
+ def unit_of_measurement(self) -> Any:
+ """Return the unit of measurement of the sensor."""
+ return UnitOfSoundPressure.DECIBEL
+
+ @property
+ def state(self) -> int | None:
+ """Return the state of the sensor."""
+
+ if self.coordinator.data:
+ data = (
+ self.coordinator.data.get("cameras", {})
+ .get(self._cam_name, {})
+ .get("audio_dBFS")
+ )
+
+ if data is not None:
+ try:
+ return round(float(data))
+ except ValueError:
+ pass
+ return None
+
+ @property
+ def icon(self) -> str:
+ """Return the icon of the sensor."""
+ return ICON_WAVEFORM
+
+
class FrigateObjectCountSensor(FrigateMQTTEntity):
"""Frigate Motion Sensor class."""
diff --git a/custom_components/frigate/translations/de.json b/custom_components/frigate/translations/de.json
index 5c8ff6e5..c554b60d 100644
--- a/custom_components/frigate/translations/de.json
+++ b/custom_components/frigate/translations/de.json
@@ -2,7 +2,7 @@
"config": {
"step": {
"user": {
- "description": "URL, die Sie für den Zugriff auf Frigate verwenden (z. B. \"http://fregate:5000/\")\n\nWenn Sie HassOS mit dem Addon verwenden, sollte die URL „http://ccab4aaf-fregate:5000/“ lauten\n\nHome Assistant benötigt für alle Funktionen Zugriff auf Port 5000 (api) und 1935 (rtmp).\n\nDie Integration richtet Sensoren, Kameras und Medienbrowser-Funktionen ein.\n\nSensoren:\n- Statistiken zur Überwachung der Frigate-Leistung\n- Objektzählungen für alle Zonen und Kameras\n\nKameras:\n- Kameras für Bild des zuletzt erkannten Objekts für jede Kamera\n- Kameraeinheiten mit Stream-Unterstützung (erfordert RTMP)\n\nMedienbrowser:\n- Umfangreiche Benutzeroberfläche mit Vorschaubildern zum Durchsuchen von Event-Clips\n- Umfangreiche Benutzeroberfläche zum Durchsuchen von 24/7-Aufzeichnungen nach Monat, Tag, Kamera und Uhrzeit\n\nAPI:\n- Benachrichtigungs-API mit öffentlich zugänglichen Endpunkten für Bilder in Benachrichtigungen",
+ "description": "URL, die Sie für den Zugriff auf Frigate verwenden (z. B. \"http://frigate:5000/\")\n\nWenn Sie HassOS mit dem Addon verwenden, sollte die URL „http://ccab4aaf-frigate:5000/“ lauten\n\nHome Assistant benötigt für alle Funktionen Zugriff auf Port 5000 (api) und 1935 (rtmp).\n\nDie Integration richtet Sensoren, Kameras und Medienbrowser-Funktionen ein.\n\nSensoren:\n- Statistiken zur Überwachung der Frigate-Leistung\n- Objektzählungen für alle Zonen und Kameras\n\nKameras:\n- Kameras für Bild des zuletzt erkannten Objekts für jede Kamera\n- Kameraeinheiten mit Stream-Unterstützung (erfordert RTMP)\n\nMedienbrowser:\n- Umfangreiche Benutzeroberfläche mit Vorschaubildern zum Durchsuchen von Event-Clips\n- Umfangreiche Benutzeroberfläche zum Durchsuchen von 24/7-Aufzeichnungen nach Monat, Tag, Kamera und Uhrzeit\n\nAPI:\n- Benachrichtigungs-API mit öffentlich zugänglichen Endpunkten für Bilder in Benachrichtigungen",
"data": {
"url": "URL"
}
@@ -32,4 +32,4 @@
"only_advanced_options": "Der erweiterte Modus ist deaktiviert und es stehen nur erweiterte Optionen zur Verfügung"
}
}
-}
\ No newline at end of file
+}
diff --git a/custom_components/frigate/translations/fr.json b/custom_components/frigate/translations/fr.json
new file mode 100644
index 00000000..7765b53f
--- /dev/null
+++ b/custom_components/frigate/translations/fr.json
@@ -0,0 +1,36 @@
+{
+ "config": {
+ "step": {
+ "user": {
+ "description": "URL que vous utilisez pour accéder à Frigate (par exemple, `http://frigate:5000/`)\n\nSi vous utilisez HassOS avec l'addon, l'URL devrait être `http://ccab4aaf-frigate:5000/`\n\nHome Assistant a besoin d'accès au port 5000 (api) et 1935 (rtmp) pour toutes les fonctionnalités.\n\nL'intégration configurera des capteurs, des caméras et la fonctionnalité de navigateur multimédia.\n\nCapteurs :\n- Statistiques pour surveiller la performance de Frigate\n- Comptes d'objets pour toutes les zones et caméras\n\nCaméras :\n- Caméras pour l'image du dernier objet détecté pour chaque caméra\n- Entités de caméra avec support de flux (nécessite RTMP)\n\nNavigateur multimédia :\n- Interface riche avec miniatures pour parcourir les clips d'événements\n- Interface riche pour parcourir les enregistrements 24/7 par mois, jour, caméra, heure\n\nAPI :\n- API de notification avec des points de terminaison publics pour les images dans les notifications",
+ "data": {
+ "url": "URL"
+ }
+ }
+ },
+ "error": {
+ "cannot_connect": "Échec de la connexion",
+ "invalid_url": "URL invalide"
+ },
+ "abort": {
+ "already_configured": "L'appareil est déjà configuré"
+ }
+ },
+ "options": {
+ "step": {
+ "init": {
+ "data": {
+ "enable_webrtc": "Activer WebRTC pour les flux de caméra",
+ "rtmp_url_template": "Modèle d'URL RTMP (voir la documentation)",
+ "rtsp_url_template": "Modèle d'URL RTSP (voir la documentation)",
+ "media_browser_enable": "Activer le navigateur multimédia",
+ "notification_proxy_enable": "Activer le proxy d'événement de notification non authentifié",
+ "notification_proxy_expire_after_seconds": "Interdire l'accès à la notification non authentifiée après secondes (0=jamais)"
+ }
+ }
+ },
+ "abort": {
+ "only_advanced_options": "Le mode avancé est désactivé et il n'y a que des options avancées"
+ }
+ }
+}
\ No newline at end of file
diff --git a/packages/blinds.yaml b/packages/blinds.yaml
index 87eb3526..9f34a149 100644
--- a/packages/blinds.yaml
+++ b/packages/blinds.yaml
@@ -202,6 +202,7 @@ automation:
alias: Close Blinds at Sunset
sequence:
- service: cover.close_cover
+ continue_on_error: true
target:
entity_id:
#- cover.office_blinds # Christmas
@@ -210,6 +211,7 @@ automation:
alias: Close Blinds Late
sequence:
- service: cover.close_cover
+ continue_on_error: true
target:
entity_id:
- cover.office_blinds
@@ -218,6 +220,7 @@ automation:
alias: Open Blinds
sequence:
- service: cover.open_cover
+ continue_on_error: true
target:
entity_id:
- cover.office_blinds
@@ -226,6 +229,7 @@ automation:
- if: "{{ states('input_boolean.guest_mode') == 'off' }}"
then:
- service: cover.open_cover
+ continue_on_error: true
target:
entity_id:
- cover.guest_bedroom_blinds
diff --git a/packages/frigate.yaml b/packages/frigate.yaml
index 113493c1..94854e04 100644
--- a/packages/frigate.yaml
+++ b/packages/frigate.yaml
@@ -66,7 +66,7 @@ automation:
- service: notify.signal_frigate
data:
message: >-
- {{ generated_content.text }}
+ A person was detected.
Clip: https://secret/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/clip.mp4
@@ -74,8 +74,8 @@ automation:
Stream: https://secret/api/camera_proxy_stream/camera.{{trigger.payload_json['after']['camera'].lower()}}?token={{state_attr( 'camera.' ~ trigger.payload_json['after']['camera'].lower(), 'access_token')}}
data:
- attachments:
- - /config/media/images/front_door.jpg
+ urls:
+ - http://localhost:8123/api/frigate/notifications/{{trigger.payload_json["after"]["id"]}}/snapshot.jpg?bbox=1×tamp=1&quality=100
- delay: '00:00:10'
- alias: Front Door on Photo Frame
diff --git a/www/community/uptime-card/uptime-card.js b/www/community/uptime-card/uptime-card.js
index 2c970413..b15064b6 100644
--- a/www/community/uptime-card/uptime-card.js
+++ b/www/community/uptime-card/uptime-card.js
@@ -12,7 +12,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
-function e(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,n,r);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,n,s):i(t,n))||s);return o>3&&s&&Object.defineProperty(t,n,s),s}var t=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,n="[^\\s]+",r=/\[([^]*?)\]/gm;function i(e,t){for(var n=[],r=0,i=e.length;r-1?r:null}};function s(e){for(var t=[],n=1;n3?0:(e-e%10!=10?1:0)*e%10]}},d=s({},u),h=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length0?"-":"+")+h(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+h(Math.floor(Math.abs(t)/60),2)+":"+h(Math.abs(t)%60,2)}},p=function(e){return+e-1},m=[null,"[1-9]\\d?"],g=[null,n],v=["isPm",n,function(e,t){var n=e.toLowerCase();return n===t.amPm[0]?0:n===t.amPm[1]?1:null}],y=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var n=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?n:-n}return 0}],b=(o("monthNamesShort"),o("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var _=function(e,n,i){if(void 0===n&&(n=b.default),void 0===i&&(i={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var o=[];n=(n=b[n]||n).replace(r,(function(e,t){return o.push(t),"@@@"}));var a=s(s({},d),i);return(n=n.replace(t,(function(t){return f[t](e,a)}))).replace(/@@@/g,(function(){return o.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}})(),function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}}();var w=["closed","locked","off"],S=function(e,t,n,r){r=r||{},n=null==n?{}:n;var i=new Event(t,{bubbles:void 0===r.bubbles||r.bubbles,cancelable:Boolean(r.cancelable),composed:void 0===r.composed||r.composed});return i.detail=n,e.dispatchEvent(i),i},x=function(e){S(window,"haptic",e)},k=function(e,t,n,r,i){var o;if(i&&n.double_tap_action?o=n.double_tap_action:r&&n.hold_action?o=n.hold_action:!r&&n.tap_action&&(o=n.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(e){return e.user===t.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||n.entity||n.camera_image)&&(S(e,"hass-more-info",{entityId:o.entity?o.entity:n.entity?n.entity:n.camera_image}),o.haptic&&x(o.haptic));break;case"navigate":o.navigation_path&&(function(e,t,n){void 0===n&&(n=!1),n?history.replaceState(null,"",t):history.pushState(null,"",t),S(window,"location-changed",{replace:n})}(0,o.navigation_path),o.haptic&&x(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&&x(o.haptic);break;case"toggle":n.entity&&(function(e,t){(function(e,t,n){void 0===n&&(n=!0);var r,i=function(e){return e.substr(0,e.indexOf("."))}(t),o="group"===i?"homeassistant":i;switch(i){case"lock":r=n?"unlock":"lock";break;case"cover":r=n?"open_cover":"close_cover";break;default:r=n?"turn_on":"turn_off"}e.callService(o,r,{entity_id:t})})(e,t,w.includes(e.states[t].state))}(t,n.entity),o.haptic&&x(o.haptic));break;case"call-service":if(!o.service)return;var s=o.service.split(".",2),a=s[0],c=s[1],l=Object.assign({},o.service_data);"entity"===l.entity_id&&(l.entity_id=n.entity),t.callService(a,c,l),o.haptic&&x(o.haptic);break;case"fire-dom-event":S(e,"ll-custom",o),o.haptic&&x(o.haptic)}};
+function e(e,t,n,i){var r,o=arguments.length,a=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,i);else for(var s=e.length-1;s>=0;s--)(r=e[s])&&(a=(o<3?r(a):o>3?r(t,n,a):r(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}var t=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,n="[^\\s]+",i=/\[([^]*?)\]/gm;function r(e,t){for(var n=[],i=0,r=e.length;i-1?i:null}};function a(e){for(var t=[],n=1;n3?0:(e-e%10!=10?1:0)*e%10]}},d=a({},u),h=function(e,t){for(void 0===t&&(t=2),e=String(e);e.length0?"-":"+")+h(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)},Z:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+h(Math.floor(Math.abs(t)/60),2)+":"+h(Math.abs(t)%60,2)}},p=function(e){return+e-1},m=[null,"[1-9]\\d?"],g=[null,n],v=["isPm",n,function(e,t){var n=e.toLowerCase();return n===t.amPm[0]?0:n===t.amPm[1]?1:null}],y=["timezoneOffset","[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z?",function(e){var t=(e+"").match(/([+-]|\d\d)/gi);if(t){var n=60*+t[1]+parseInt(t[2],10);return"+"===t[0]?n:-n}return 0}],b=(o("monthNamesShort"),o("monthNames"),{default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",isoDate:"YYYY-MM-DD",isoDateTime:"YYYY-MM-DDTHH:mm:ssZ",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"});var _=function(e,n,r){if(void 0===n&&(n=b.default),void 0===r&&(r={}),"number"==typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date pass to format");var o=[];n=(n=b[n]||n).replace(i,(function(e,t){return o.push(t),"@@@"}));var s=a(a({},d),r);return(n=n.replace(t,(function(t){return f[t](e,s)}))).replace(/@@@/g,(function(){return o.shift()}))};(function(){try{(new Date).toLocaleDateString("i")}catch(e){return"RangeError"===e.name}})(),function(){try{(new Date).toLocaleString("i")}catch(e){return"RangeError"===e.name}}(),function(){try{(new Date).toLocaleTimeString("i")}catch(e){return"RangeError"===e.name}}();var w=["closed","locked","off"],S=function(e,t,n,i){i=i||{},n=null==n?{}:n;var r=new Event(t,{bubbles:void 0===i.bubbles||i.bubbles,cancelable:Boolean(i.cancelable),composed:void 0===i.composed||i.composed});return r.detail=n,e.dispatchEvent(r),r},x=function(e){S(window,"haptic",e)},k=function(e,t,n,i,r){var o;if(r&&n.double_tap_action?o=n.double_tap_action:i&&n.hold_action?o=n.hold_action:!i&&n.tap_action&&(o=n.tap_action),o||(o={action:"more-info"}),!o.confirmation||o.confirmation.exemptions&&o.confirmation.exemptions.some((function(e){return e.user===t.user.id}))||confirm(o.confirmation.text||"Are you sure you want to "+o.action+"?"))switch(o.action){case"more-info":(o.entity||n.entity||n.camera_image)&&(S(e,"hass-more-info",{entityId:o.entity?o.entity:n.entity?n.entity:n.camera_image}),o.haptic&&x(o.haptic));break;case"navigate":o.navigation_path&&(function(e,t,n){void 0===n&&(n=!1),n?history.replaceState(null,"",t):history.pushState(null,"",t),S(window,"location-changed",{replace:n})}(0,o.navigation_path),o.haptic&&x(o.haptic));break;case"url":o.url_path&&window.open(o.url_path),o.haptic&&x(o.haptic);break;case"toggle":n.entity&&(function(e,t){(function(e,t,n){void 0===n&&(n=!0);var i,r=function(e){return e.substr(0,e.indexOf("."))}(t),o="group"===r?"homeassistant":r;switch(r){case"lock":i=n?"unlock":"lock";break;case"cover":i=n?"open_cover":"close_cover";break;default:i=n?"turn_on":"turn_off"}e.callService(o,i,{entity_id:t})})(e,t,w.includes(e.states[t].state))}(t,n.entity),o.haptic&&x(o.haptic));break;case"call-service":if(!o.service)return;var a=o.service.split(".",2),s=a[0],c=a[1],l=Object.assign({},o.service_data);"entity"===l.entity_id&&(l.entity_id=n.entity),t.callService(s,c,l),o.haptic&&x(o.haptic);break;case"fire-dom-event":S(e,"ll-custom",o),o.haptic&&x(o.haptic)}};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -26,7 +26,7 @@ function e(e,t,n,r){var i,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPro
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-const P="undefined"!=typeof window&&null!=window.customElements&&void 0!==window.customElements.polyfillWrapFlushCallback,C=(e,t,n=null)=>{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}},N=`{{lit-${String(Math.random()).slice(2)}}}`,O=`\x3c!--${N}--\x3e`,I=new RegExp(`${N}|${O}`);class T{constructor(e,t){this.parts=[],this.element=t;const n=[],r=[],i=document.createTreeWalker(t.content,133,null,!1);let o=0,s=-1,a=0;const{strings:c,values:{length:l}}=e;for(;a0;){const t=c[a],n=D.exec(t)[2],r=n.toLowerCase()+"$lit$",i=e.getAttribute(r);e.removeAttribute(r);const o=i.split(I);this.parts.push({type:"attribute",index:s,name:n,strings:o}),a+=o.length-1}}"TEMPLATE"===e.tagName&&(r.push(e),i.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(N)>=0){const r=e.parentNode,i=t.split(I),o=i.length-1;for(let t=0;t{const n=e.length-t.length;return n>=0&&e.slice(n)===t},E=e=>-1!==e.index,$=()=>document.createComment(""),D=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function j(e,t){const{element:{content:n},parts:r}=e,i=document.createTreeWalker(n,133,null,!1);let o=R(r),s=r[o],a=-1,c=0;const l=[];let u=null;for(;i.nextNode();){a++;const e=i.currentNode;for(e.previousSibling===u&&(u=null),t.has(e)&&(l.push(e),null===u&&(u=e)),null!==u&&c++;void 0!==s&&s.index===a;)s.index=null!==u?-1:s.index-c,o=R(r,o),s=r[o]}l.forEach(e=>e.parentNode.removeChild(e))}const M=e=>{let t=11===e.nodeType?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},R=(e,t=-1)=>{for(let n=t+1;n{for(;t!==n;){const n=t.nextSibling;e.removeChild(t),t=n}},C=`{{lit-${String(Math.random()).slice(2)}}}`,N=`\x3c!--${C}--\x3e`,I=new RegExp(`${C}|${N}`);class T{constructor(e,t){this.parts=[],this.element=t;const n=[],i=[],r=document.createTreeWalker(t.content,133,null,!1);let o=0,a=-1,s=0;const{strings:c,values:{length:l}}=e;for(;s0;){const t=c[s],n=D.exec(t)[2],i=n.toLowerCase()+"$lit$",r=e.getAttribute(i);e.removeAttribute(i);const o=r.split(I);this.parts.push({type:"attribute",index:a,name:n,strings:o}),s+=o.length-1}}"TEMPLATE"===e.tagName&&(i.push(e),r.currentNode=e.content)}else if(3===e.nodeType){const t=e.data;if(t.indexOf(C)>=0){const i=e.parentNode,r=t.split(I),o=r.length-1;for(let t=0;t{const n=e.length-t.length;return n>=0&&e.slice(n)===t},E=e=>-1!==e.index,$=()=>document.createComment(""),D=/([ \x09\x0a\x0c\x0d])([^\0-\x1F\x7F-\x9F "'>=/]+)([ \x09\x0a\x0c\x0d]*=[ \x09\x0a\x0c\x0d]*(?:[^ \x09\x0a\x0c\x0d"'`<>=]*|"[^"]*|'[^']*))$/;function j(e,t){const{element:{content:n},parts:i}=e,r=document.createTreeWalker(n,133,null,!1);let o=R(i),a=i[o],s=-1,c=0;const l=[];let u=null;for(;r.nextNode();){s++;const e=r.currentNode;for(e.previousSibling===u&&(u=null),t.has(e)&&(l.push(e),null===u&&(u=e)),null!==u&&c++;void 0!==a&&a.index===s;)a.index=null!==u?-1:a.index-c,o=R(i,o),a=i[o]}l.forEach(e=>e.parentNode.removeChild(e))}const M=e=>{let t=11===e.nodeType?0:1;const n=document.createTreeWalker(e,133,null,!1);for(;n.nextNode();)t++;return t},R=(e,t=-1)=>{for(let n=t+1;n"function"==typeof e&&B.has(e),U={},V={};
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-class L{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this.options=n}update(e){let t=0;for(const n of this.__parts)void 0!==n&&n.setValue(e[t]),t++;for(const e of this.__parts)void 0!==e&&e.commit()}_clone(){const e=P?this.template.element.content.cloneNode(!0):document.importNode(this.template.element.content,!0),t=[],n=this.template.parts,r=document.createTreeWalker(e,133,null,!1);let i,o=0,s=0,a=r.nextNode();for(;oe}),H=` ${N} `;class Y{constructor(e,t,n,r){this.strings=e,this.values=t,this.type=n,this.processor=r}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let r=0;r-1||n)&&-1===e.indexOf("--\x3e",i+1);const o=D.exec(e);t+=null===o?e+(n?H:O):e.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+N}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==F&&(t=F.createHTML(t)),e.innerHTML=t,e}}class W extends Y{getHTML(){return``}getTemplateElement(){const e=super.getTemplateElement(),t=e.content,n=t.firstChild;return t.removeChild(n),((e,t,n=null,r=null)=>{for(;t!==n;){const n=t.nextSibling;e.insertBefore(t,r),t=n}})(t,n.firstChild),e}}
+ */const H=window.trustedTypes&&trustedTypes.createPolicy("lit-html",{createHTML:e=>e}),L=` ${C} `;class q{constructor(e,t,n,i){this.strings=e,this.values=t,this.type=n,this.processor=i}getHTML(){const e=this.strings.length-1;let t="",n=!1;for(let i=0;i-1||n)&&-1===e.indexOf("--\x3e",r+1);const o=D.exec(e);t+=null===o?e+(n?L:N):e.substr(0,o.index)+o[1]+o[2]+"$lit$"+o[3]+C}return t+=this.strings[e],t}getTemplateElement(){const e=document.createElement("template");let t=this.getHTML();return void 0!==H&&(t=H.createHTML(t)),e.innerHTML=t,e}}class Y extends q{getHTML(){return``}getTemplateElement(){const e=super.getTemplateElement(),t=e.content,n=t.firstChild;return t.removeChild(n),((e,t,n=null,i=null)=>{for(;t!==n;){const n=t.nextSibling;e.insertBefore(t,i),t=n}})(t,n.firstChild),e}}
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -80,7 +80,7 @@ class L{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
- */const q=e=>null===e||!("object"==typeof e||"function"==typeof e),J=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class K{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e{try{const e={get capture(){return te=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class ne{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;z(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=U,e(this)}if(this.__pendingValue===U)return;const e=this.__pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),r=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),r&&(this.__options=re(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=U}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const re=e=>e&&(te?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)
+ */const W=e=>null===e||!("object"==typeof e||"function"==typeof e),J=e=>Array.isArray(e)||!(!e||!e[Symbol.iterator]);class K{constructor(e,t,n){this.dirty=!0,this.element=e,this.name=t,this.strings=n,this.parts=[];for(let e=0;e{try{const e={get capture(){return te=!0,!1}};window.addEventListener("test",e,e),window.removeEventListener("test",e,e)}catch(e){}})();class ne{constructor(e,t,n){this.value=void 0,this.__pendingValue=void 0,this.element=e,this.eventName=t,this.eventContext=n,this.__boundHandleEvent=e=>this.handleEvent(e)}setValue(e){this.__pendingValue=e}commit(){for(;z(this.__pendingValue);){const e=this.__pendingValue;this.__pendingValue=U,e(this)}if(this.__pendingValue===U)return;const e=this.__pendingValue,t=this.value,n=null==e||null!=t&&(e.capture!==t.capture||e.once!==t.once||e.passive!==t.passive),i=null!=e&&(null==t||n);n&&this.element.removeEventListener(this.eventName,this.__boundHandleEvent,this.__options),i&&(this.__options=ie(e),this.element.addEventListener(this.eventName,this.__boundHandleEvent,this.__options)),this.value=e,this.__pendingValue=U}handleEvent(e){"function"==typeof this.value?this.value.call(this.eventContext||this.element,e):this.value.handleEvent(e)}}const ie=e=>e&&(te?{capture:e.capture,passive:e.passive,once:e.once}:e.capture)
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -93,7 +93,7 @@ class L{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
- */;function ie(e){let t=oe.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},oe.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const r=e.strings.join(N);return n=t.keyString.get(r),void 0===n&&(n=new T(e,e.getTemplateElement()),t.keyString.set(r,n)),t.stringsArray.set(e.strings,n),n}const oe=new Map,se=new WeakMap;
+ */;function re(e){let t=oe.get(e.type);void 0===t&&(t={stringsArray:new WeakMap,keyString:new Map},oe.set(e.type,t));let n=t.stringsArray.get(e.strings);if(void 0!==n)return n;const i=e.strings.join(C);return n=t.keyString.get(i),void 0===n&&(n=new T(e,e.getTemplateElement()),t.keyString.set(i,n)),t.stringsArray.set(e.strings,n),n}const oe=new Map,ae=new WeakMap;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -106,7 +106,7 @@ class L{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
- */const ae=new
+ */const se=new
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -120,7 +120,7 @@ class L{constructor(e,t,n){this.__parts=[],this.template=e,this.processor=t,this
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new X(e,t.slice(1),n).parts}if("@"===i)return[new ne(e,t.slice(1),r.eventContext)];if("?"===i)return[new G(e,t.slice(1),n)];return new K(e,t,n).parts}handleTextExpression(e){return new Q(e)}};
+class{handleAttributeExpressions(e,t,n,i){const r=t[0];if("."===r){return new X(e,t.slice(1),n).parts}if("@"===r)return[new ne(e,t.slice(1),i.eventContext)];if("?"===r)return[new G(e,t.slice(1),n)];return new K(e,t,n).parts}handleTextExpression(e){return new Q(e)}};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -133,7 +133,7 @@ class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new X(
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
- */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const ce=(e,...t)=>new Y(e,t,"html",ae),le=(e,...t)=>new W(e,t,"svg",ae)
+ */"undefined"!=typeof window&&(window.litHtmlVersions||(window.litHtmlVersions=[])).push("1.3.0");const ce=(e,...t)=>new q(e,t,"html",se),le=(e,...t)=>new Y(e,t,"svg",se)
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -146,7 +146,7 @@ class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new X(
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
- */,ue=(e,t)=>`${e}--${t}`;let de=!0;void 0===window.ShadyCSS?de=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),de=!1);const he=e=>t=>{const n=ue(t.type,e);let r=oe.get(n);void 0===r&&(r={stringsArray:new WeakMap,keyString:new Map},oe.set(n,r));let i=r.stringsArray.get(t.strings);if(void 0!==i)return i;const o=t.strings.join(N);if(i=r.keyString.get(o),void 0===i){const n=t.getTemplateElement();de&&window.ShadyCSS.prepareTemplateDom(n,e),i=new T(t,n),r.keyString.set(o,i)}return r.stringsArray.set(t.strings,i),i},fe=["html","svg"],pe=new Set,me=(e,t,n)=>{pe.add(e);const r=n?n.element:document.createElement("template"),i=t.querySelectorAll("style"),{length:o}=i;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(r,e);const s=document.createElement("style");for(let e=0;e{fe.forEach(t=>{const n=oe.get(ue(t,e));void 0!==n&&n.keyString.forEach(e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{n.add(e)}),j(e,n)})})})(e);const a=r.content;n?function(e,t,n=null){const{element:{content:r},parts:i}=e;if(null==n)return void r.appendChild(t);const o=document.createTreeWalker(r,133,null,!1);let s=R(i),a=0,c=-1;for(;o.nextNode();){c++;for(o.currentNode===n&&(a=M(t),n.parentNode.insertBefore(t,n));-1!==s&&i[s].index===c;){if(a>0){for(;-1!==s;)i[s].index+=a,s=R(i,s);return}s=R(i,s)}}}(n,s,a.firstChild):a.insertBefore(s,a.firstChild),window.ShadyCSS.prepareTemplateStyles(r,e);const c=a.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==c)t.insertBefore(c.cloneNode(!0),t.firstChild);else if(n){a.insertBefore(s,a.firstChild);const e=new Set;e.add(s),j(n,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const ge={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},ve=(e,t)=>t!==e&&(t==t||e==e),ye={attribute:!0,type:String,converter:ge,reflect:!1,hasChanged:ve};class be extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,n)=>{const r=this._attributeNameForProperty(n,t);void 0!==r&&(this._attributeToPropertyMap.set(r,n),e.push(r))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=ye){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n="symbol"==typeof e?Symbol():"__"+e,r=this.getPropertyDescriptor(e,n,t);void 0!==r&&Object.defineProperty(this.prototype,e,r)}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(r){const i=this[e];this[t]=r,this.requestUpdateInternal(e,i,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||ye}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const n of t)this.createProperty(n,e[n])}}static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,n=ve){return n(e,t)}static _propertyValueFromAttribute(e,t){const n=t.type,r=t.converter||ge,i="function"==typeof r?r:r.fromAttribute;return i?i(e,n):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const n=t.type,r=t.converter;return(r&&r.toAttribute||ge.toAttribute)(e,n)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}_propertyToAttribute(e,t,n=ye){const r=this.constructor,i=r._attributeNameForProperty(e,n);if(void 0!==i){const e=r._propertyValueToAttribute(t,n);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(i):this.setAttribute(i,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const n=this.constructor,r=n._attributeToPropertyMap.get(e);if(void 0!==r){const e=n.getPropertyOptions(r);this._updateState=16|this._updateState,this[r]=n._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,n){let r=!0;if(void 0!==e){const i=this.constructor;n=n||i.getPropertyOptions(e),i._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):r=!1}!this._hasRequestedUpdate&&r&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}be.finalized=!0;
+ */,ue=(e,t)=>`${e}--${t}`;let de=!0;void 0===window.ShadyCSS?de=!1:void 0===window.ShadyCSS.prepareTemplateDom&&(console.warn("Incompatible ShadyCSS version detected. Please update to at least @webcomponents/webcomponentsjs@2.0.2 and @webcomponents/shadycss@1.3.1."),de=!1);const he=e=>t=>{const n=ue(t.type,e);let i=oe.get(n);void 0===i&&(i={stringsArray:new WeakMap,keyString:new Map},oe.set(n,i));let r=i.stringsArray.get(t.strings);if(void 0!==r)return r;const o=t.strings.join(C);if(r=i.keyString.get(o),void 0===r){const n=t.getTemplateElement();de&&window.ShadyCSS.prepareTemplateDom(n,e),r=new T(t,n),i.keyString.set(o,r)}return i.stringsArray.set(t.strings,r),r},fe=["html","svg"],pe=new Set,me=(e,t,n)=>{pe.add(e);const i=n?n.element:document.createElement("template"),r=t.querySelectorAll("style"),{length:o}=r;if(0===o)return void window.ShadyCSS.prepareTemplateStyles(i,e);const a=document.createElement("style");for(let e=0;e{fe.forEach(t=>{const n=oe.get(ue(t,e));void 0!==n&&n.keyString.forEach(e=>{const{element:{content:t}}=e,n=new Set;Array.from(t.querySelectorAll("style")).forEach(e=>{n.add(e)}),j(e,n)})})})(e);const s=i.content;n?function(e,t,n=null){const{element:{content:i},parts:r}=e;if(null==n)return void i.appendChild(t);const o=document.createTreeWalker(i,133,null,!1);let a=R(r),s=0,c=-1;for(;o.nextNode();){c++;for(o.currentNode===n&&(s=M(t),n.parentNode.insertBefore(t,n));-1!==a&&r[a].index===c;){if(s>0){for(;-1!==a;)r[a].index+=s,a=R(r,a);return}a=R(r,a)}}}(n,a,s.firstChild):s.insertBefore(a,s.firstChild),window.ShadyCSS.prepareTemplateStyles(i,e);const c=s.querySelector("style");if(window.ShadyCSS.nativeShadow&&null!==c)t.insertBefore(c.cloneNode(!0),t.firstChild);else if(n){s.insertBefore(a,s.firstChild);const e=new Set;e.add(a),j(n,e)}};window.JSCompiler_renameProperty=(e,t)=>e;const ge={toAttribute(e,t){switch(t){case Boolean:return e?"":null;case Object:case Array:return null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){switch(t){case Boolean:return null!==e;case Number:return null===e?null:Number(e);case Object:case Array:return JSON.parse(e)}return e}},ve=(e,t)=>t!==e&&(t==t||e==e),ye={attribute:!0,type:String,converter:ge,reflect:!1,hasChanged:ve};class be extends HTMLElement{constructor(){super(),this.initialize()}static get observedAttributes(){this.finalize();const e=[];return this._classProperties.forEach((t,n)=>{const i=this._attributeNameForProperty(n,t);void 0!==i&&(this._attributeToPropertyMap.set(i,n),e.push(i))}),e}static _ensureClassProperties(){if(!this.hasOwnProperty(JSCompiler_renameProperty("_classProperties",this))){this._classProperties=new Map;const e=Object.getPrototypeOf(this)._classProperties;void 0!==e&&e.forEach((e,t)=>this._classProperties.set(t,e))}}static createProperty(e,t=ye){if(this._ensureClassProperties(),this._classProperties.set(e,t),t.noAccessor||this.prototype.hasOwnProperty(e))return;const n="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,n,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}static getPropertyDescriptor(e,t,n){return{get(){return this[t]},set(i){const r=this[e];this[t]=i,this.requestUpdateInternal(e,r,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this._classProperties&&this._classProperties.get(e)||ye}static finalize(){const e=Object.getPrototypeOf(this);if(e.hasOwnProperty("finalized")||e.finalize(),this.finalized=!0,this._ensureClassProperties(),this._attributeToPropertyMap=new Map,this.hasOwnProperty(JSCompiler_renameProperty("properties",this))){const e=this.properties,t=[...Object.getOwnPropertyNames(e),..."function"==typeof Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(e):[]];for(const n of t)this.createProperty(n,e[n])}}static _attributeNameForProperty(e,t){const n=t.attribute;return!1===n?void 0:"string"==typeof n?n:"string"==typeof e?e.toLowerCase():void 0}static _valueHasChanged(e,t,n=ve){return n(e,t)}static _propertyValueFromAttribute(e,t){const n=t.type,i=t.converter||ge,r="function"==typeof i?i:i.fromAttribute;return r?r(e,n):e}static _propertyValueToAttribute(e,t){if(void 0===t.reflect)return;const n=t.type,i=t.converter;return(i&&i.toAttribute||ge.toAttribute)(e,n)}initialize(){this._updateState=0,this._updatePromise=new Promise(e=>this._enableUpdatingResolver=e),this._changedProperties=new Map,this._saveInstanceProperties(),this.requestUpdateInternal()}_saveInstanceProperties(){this.constructor._classProperties.forEach((e,t)=>{if(this.hasOwnProperty(t)){const e=this[t];delete this[t],this._instanceProperties||(this._instanceProperties=new Map),this._instanceProperties.set(t,e)}})}_applyInstanceProperties(){this._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}connectedCallback(){this.enableUpdating()}enableUpdating(){void 0!==this._enableUpdatingResolver&&(this._enableUpdatingResolver(),this._enableUpdatingResolver=void 0)}disconnectedCallback(){}attributeChangedCallback(e,t,n){t!==n&&this._attributeToProperty(e,n)}_propertyToAttribute(e,t,n=ye){const i=this.constructor,r=i._attributeNameForProperty(e,n);if(void 0!==r){const e=i._propertyValueToAttribute(t,n);if(void 0===e)return;this._updateState=8|this._updateState,null==e?this.removeAttribute(r):this.setAttribute(r,e),this._updateState=-9&this._updateState}}_attributeToProperty(e,t){if(8&this._updateState)return;const n=this.constructor,i=n._attributeToPropertyMap.get(e);if(void 0!==i){const e=n.getPropertyOptions(i);this._updateState=16|this._updateState,this[i]=n._propertyValueFromAttribute(t,e),this._updateState=-17&this._updateState}}requestUpdateInternal(e,t,n){let i=!0;if(void 0!==e){const r=this.constructor;n=n||r.getPropertyOptions(e),r._valueHasChanged(this[e],t,n.hasChanged)?(this._changedProperties.has(e)||this._changedProperties.set(e,t),!0!==n.reflect||16&this._updateState||(void 0===this._reflectingProperties&&(this._reflectingProperties=new Map),this._reflectingProperties.set(e,n))):i=!1}!this._hasRequestedUpdate&&i&&(this._updatePromise=this._enqueueUpdate())}requestUpdate(e,t){return this.requestUpdateInternal(e,t),this.updateComplete}async _enqueueUpdate(){this._updateState=4|this._updateState;try{await this._updatePromise}catch(e){}const e=this.performUpdate();return null!=e&&await e,!this._hasRequestedUpdate}get _hasRequestedUpdate(){return 4&this._updateState}get hasUpdated(){return 1&this._updateState}performUpdate(){if(!this._hasRequestedUpdate)return;this._instanceProperties&&this._applyInstanceProperties();let e=!1;const t=this._changedProperties;try{e=this.shouldUpdate(t),e?this.update(t):this._markUpdated()}catch(t){throw e=!1,this._markUpdated(),t}e&&(1&this._updateState||(this._updateState=1|this._updateState,this.firstUpdated(t)),this.updated(t))}_markUpdated(){this._changedProperties=new Map,this._updateState=-5&this._updateState}get updateComplete(){return this._getUpdateComplete()}_getUpdateComplete(){return this._updatePromise}shouldUpdate(e){return!0}update(e){void 0!==this._reflectingProperties&&this._reflectingProperties.size>0&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0),this._markUpdated()}updated(e){}firstUpdated(e){}}be.finalized=!0;
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -160,7 +160,7 @@ class{handleAttributeExpressions(e,t,n,r){const i=t[0];if("."===i){return new X(
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-const _e=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:r}=t;return{kind:n,elements:r,finisher(t){window.customElements.define(e,t)}}})(e,t),we=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function Se(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):we(e,t)}function xe(e){return Se({attribute:!1,hasChanged:null==e?void 0:e.hasChanged})}
+const _e=e=>t=>"function"==typeof t?((e,t)=>(window.customElements.define(e,t),t))(e,t):((e,t)=>{const{kind:n,elements:i}=t;return{kind:n,elements:i,finisher(t){window.customElements.define(e,t)}}})(e,t),we=(e,t)=>"method"===t.kind&&t.descriptor&&!("value"in t.descriptor)?Object.assign(Object.assign({},t),{finisher(n){n.createProperty(t.key,e)}}):{kind:"field",key:Symbol(),placement:"own",descriptor:{},initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(n){n.createProperty(t.key,e)}};function Se(e){return(t,n)=>void 0!==n?((e,t,n)=>{t.constructor.createProperty(n,e)})(e,t,n):we(e,t)}function xe(e){return Se({attribute:!1,hasChanged:null==e?void 0:e.hasChanged})}
/**
@license
Copyright (c) 2019 The Polymer Project Authors. All rights reserved.
@@ -170,7 +170,7 @@ http://polymer.github.io/AUTHORS.txt The complete set of contributors may be
found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as
part of the polymer project is also subject to an additional IP rights grant
found at http://polymer.github.io/PATENTS.txt
-*/const ke=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pe=Symbol();class Ce{constructor(e,t){if(t!==Pe)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(ke?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const Ne=(e,...t)=>{const n=t.reduce((t,n,r)=>t+(e=>{if(e instanceof Ce)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+e[r+1],e[0]);return new Ce(n,Pe)};
+*/const ke=window.ShadowRoot&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Pe=Symbol();class Oe{constructor(e,t){if(t!==Pe)throw new Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e}get styleSheet(){return void 0===this._styleSheet&&(ke?(this._styleSheet=new CSSStyleSheet,this._styleSheet.replaceSync(this.cssText)):this._styleSheet=null),this._styleSheet}toString(){return this.cssText}}const Ce=(e,...t)=>{const n=t.reduce((t,n,i)=>t+(e=>{if(e instanceof Oe)return e.cssText;if("number"==typeof e)return e;throw new Error(`Value passed to 'css' function must be a 'css' function result: ${e}. Use 'unsafeCSS' to pass non-literal values, but\n take care to ensure page security.`)})(n)+e[i+1],e[0]);return new Oe(n,Pe)};
/**
* @license
* Copyright (c) 2017 The Polymer Project Authors. All rights reserved.
@@ -184,7 +184,7 @@ found at http://polymer.github.io/PATENTS.txt
* subject to an additional IP rights grant found at
* http://polymer.github.io/PATENTS.txt
*/
-(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const Oe={};class Ie extends be{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,n)=>e.reduceRight((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e),n),n=t(e,new Set),r=[];n.forEach(e=>r.unshift(e)),this._styles=r}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!ke){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new Ce(String(t),Pe)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ke?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==Oe&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return Oe}}Ie.finalized=!0,Ie.render=(e,t,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const r=n.scopeName,i=se.has(t),o=de&&11===t.nodeType&&!!t.host,s=o&&!pe.has(r),a=s?document.createDocumentFragment():t;if(((e,t,n)=>{let r=se.get(t);void 0===r&&(C(t,t.firstChild),se.set(t,r=new Q(Object.assign({templateFactory:ie},n))),r.appendInto(t)),r.setValue(e),r.commit()})(e,a,Object.assign({templateFactory:he(r)},n)),s){const e=se.get(a);se.delete(a);const n=e.value instanceof L?e.value.template:void 0;me(r,a,n),C(t,t.firstChild),t.appendChild(a),se.set(t,e)}!i&&o&&window.ShadyCSS.styleElement(t.host)};const Te={hours_to_show:24,severity:100,update_interval:30,title_template:"[[[ return entity.attributes.friendly_name; ]]]",average_template:"[[[ return variables.uptime.toFixed(2); ]]]%",status_template:"[[[ return variables.current; ]]]",title_adaptive_color:!1,status_adaptive_color:!1,icon_adaptive_color:!1,tooltip_adaptive_color:!1},Ae={ok:"#45C669",ko:"#C66445",half:"#C6B145",none:"#C9C9C9",title:"grey",status:"grey",tooltip:"grey",footer:"#AAAAAA",icon:"var(--state-icon-color)"},Ee={header:!0,title:!0,icon:!0,status:!0,timeline:!0,footer:!0,average:!0},$e={height:46,round:1,spacing:4,amount:36},De={hour24:!1,template:"[[[ return variables.from_date; ]]] - [[[ return variables.to_date; ]]] | [[[ return variables.average; ]]]%",animation:!0},je={action:"more-info"},Me={header:"spaced",icon_first:!1,status:"spaced",tooltip_first:!1},Re={animation:"raise",duration:.5},Be={title:25,status:25};let ze=class extends Ie{constructor(){super(...arguments),this._initialized=!1}setConfig(e){this._config=e,this.loadCardHelpers()}shouldUpdate(){return this._initialized||this._initialize(),!0}render(){return this.hass&&this._helpers&&this.options?(this._helpers.importMoreInfoControl("climate"),ce`
+(window.litElementVersions||(window.litElementVersions=[])).push("2.4.0");const Ne={};class Ie extends be{static getStyles(){return this.styles}static _getUniqueStyles(){if(this.hasOwnProperty(JSCompiler_renameProperty("_styles",this)))return;const e=this.getStyles();if(Array.isArray(e)){const t=(e,n)=>e.reduceRight((e,n)=>Array.isArray(n)?t(n,e):(e.add(n),e),n),n=t(e,new Set),i=[];n.forEach(e=>i.unshift(e)),this._styles=i}else this._styles=void 0===e?[]:[e];this._styles=this._styles.map(e=>{if(e instanceof CSSStyleSheet&&!ke){const t=Array.prototype.slice.call(e.cssRules).reduce((e,t)=>e+t.cssText,"");return new Oe(String(t),Pe)}return e})}initialize(){super.initialize(),this.constructor._getUniqueStyles(),this.renderRoot=this.createRenderRoot(),window.ShadowRoot&&this.renderRoot instanceof window.ShadowRoot&&this.adoptStyles()}createRenderRoot(){return this.attachShadow({mode:"open"})}adoptStyles(){const e=this.constructor._styles;0!==e.length&&(void 0===window.ShadyCSS||window.ShadyCSS.nativeShadow?ke?this.renderRoot.adoptedStyleSheets=e.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):this._needsShimAdoptedStyleSheets=!0:window.ShadyCSS.ScopingShim.prepareAdoptedCssText(e.map(e=>e.cssText),this.localName))}connectedCallback(){super.connectedCallback(),this.hasUpdated&&void 0!==window.ShadyCSS&&window.ShadyCSS.styleElement(this)}update(e){const t=this.render();super.update(e),t!==Ne&&this.constructor.render(t,this.renderRoot,{scopeName:this.localName,eventContext:this}),this._needsShimAdoptedStyleSheets&&(this._needsShimAdoptedStyleSheets=!1,this.constructor._styles.forEach(e=>{const t=document.createElement("style");t.textContent=e.cssText,this.renderRoot.appendChild(t)}))}render(){return Ne}}Ie.finalized=!0,Ie.render=(e,t,n)=>{if(!n||"object"!=typeof n||!n.scopeName)throw new Error("The `scopeName` option is required.");const i=n.scopeName,r=ae.has(t),o=de&&11===t.nodeType&&!!t.host,a=o&&!pe.has(i),s=a?document.createDocumentFragment():t;if(((e,t,n)=>{let i=ae.get(t);void 0===i&&(O(t,t.firstChild),ae.set(t,i=new Q(Object.assign({templateFactory:re},n))),i.appendInto(t)),i.setValue(e),i.commit()})(e,s,Object.assign({templateFactory:he(i)},n)),a){const e=ae.get(s);ae.delete(s);const n=e.value instanceof F?e.value.template:void 0;me(i,s,n),O(t,t.firstChild),t.appendChild(s),ae.set(t,e)}!r&&o&&window.ShadyCSS.styleElement(t.host)};const Te={severity:100,update_interval:30,title_template:"[[[ return entity.attributes.friendly_name; ]]]",average_template:"[[[ return variables.uptime.toFixed(2); ]]]%",status_template:"[[[ return variables.current; ]]]",title_adaptive_color:!1,status_adaptive_color:!1,icon_adaptive_color:!1,tooltip_adaptive_color:!1},Ae={ok:"#45C669",ko:"#C66445",half:"#C6B145",none:"#C9C9C9",title:"grey",status:"grey",tooltip:"grey",footer:"#AAAAAA",icon:"var(--state-icon-color)"},Ee={header:!0,title:!0,icon:!0,status:!0,timeline:!0,footer:!0,average:!0},$e={height:46,round:1,spacing:4,amount:36},De={hour24:!1,template:"[[[ return variables.from_date; ]]] - [[[ return variables.to_date; ]]] | [[[ return variables.average; ]]]%",animation:!0},je={action:"more-info"},Me={header:"spaced",icon_first:!1,status:"spaced",tooltip_first:!1},Re={animation:"raise",duration:.5},Be={title:25,status:25},ze={quantity:1,unit:"day"};let Ue=class extends Ie{constructor(){super(...arguments),this._initialized=!1}setConfig(e){this._config=e,this.loadCardHelpers()}shouldUpdate(){return this._initialized||this._initialize(),!0}render(){return this.hass&&this._helpers&&this.options?(this._helpers.importMoreInfoControl("climate"),ce`