Use new enums in goalzero (#61518)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-12-13 05:24:57 +01:00 committed by GitHub
parent c060b5926c
commit c69e479bfd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 31 additions and 39 deletions

View file

@ -4,15 +4,14 @@ from __future__ import annotations
from typing import cast
from homeassistant.components.binary_sensor import (
DEVICE_CLASS_BATTERY_CHARGING,
DEVICE_CLASS_CONNECTIVITY,
DEVICE_CLASS_POWER,
BinarySensorDeviceClass,
BinarySensorEntity,
BinarySensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_NAME, ENTITY_CATEGORY_DIAGNOSTIC
from homeassistant.const import CONF_NAME
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
@ -30,18 +29,18 @@ BINARY_SENSOR_TYPES: tuple[BinarySensorEntityDescription, ...] = (
BinarySensorEntityDescription(
key="app_online",
name="App Online",
device_class=DEVICE_CLASS_CONNECTIVITY,
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
device_class=BinarySensorDeviceClass.CONNECTIVITY,
entity_category=EntityCategory.DIAGNOSTIC,
),
BinarySensorEntityDescription(
key="isCharging",
name="Charging",
device_class=DEVICE_CLASS_BATTERY_CHARGING,
device_class=BinarySensorDeviceClass.BATTERY_CHARGING,
),
BinarySensorEntityDescription(
key="inputDetected",
name="Input Detected",
device_class=DEVICE_CLASS_POWER,
device_class=BinarySensorDeviceClass.POWER,
),
)