mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 11:29:46 +00:00
Add save clips to Blink services (#84149)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
"""Support for Blink system camera control."""
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
@@ -20,6 +22,8 @@ from .const import (
|
||||
TYPE_MOTION_DETECTED,
|
||||
)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
BINARY_SENSORS_TYPES: tuple[BinarySensorEntityDescription, ...] = (
|
||||
BinarySensorEntityDescription(
|
||||
key=TYPE_BATTERY,
|
||||
@@ -74,8 +78,13 @@ class BlinkBinarySensor(BinarySensorEntity):
|
||||
|
||||
def update(self) -> None:
|
||||
"""Update sensor state."""
|
||||
self.data.refresh()
|
||||
state = self._camera.attributes[self.entity_description.key]
|
||||
_LOGGER.debug(
|
||||
"'%s' %s = %s",
|
||||
self._camera.attributes["name"],
|
||||
self.entity_description.key,
|
||||
state,
|
||||
)
|
||||
if self.entity_description.key == TYPE_BATTERY:
|
||||
state = state != "ok"
|
||||
self._attr_is_on = state
|
||||
|
||||
Reference in New Issue
Block a user