Clean up Ombi const file (#95541)

pull/96996/head
Joost Lekkerkerker 2023-07-21 11:55:31 +02:00 committed by GitHub
parent 4fa9f25e38
commit 52313bfce5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 36 deletions

View File

@ -1,8 +1,6 @@
"""Support for Ombi.""" """Support for Ombi."""
from __future__ import annotations from __future__ import annotations
from homeassistant.components.sensor import SensorEntityDescription
ATTR_SEASON = "season" ATTR_SEASON = "season"
CONF_URLBASE = "urlbase" CONF_URLBASE = "urlbase"
@ -16,36 +14,3 @@ DEFAULT_URLBASE = ""
SERVICE_MOVIE_REQUEST = "submit_movie_request" SERVICE_MOVIE_REQUEST = "submit_movie_request"
SERVICE_MUSIC_REQUEST = "submit_music_request" SERVICE_MUSIC_REQUEST = "submit_music_request"
SERVICE_TV_REQUEST = "submit_tv_request" SERVICE_TV_REQUEST = "submit_tv_request"
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
key="movies",
name="Movie requests",
icon="mdi:movie",
),
SensorEntityDescription(
key="tv",
name="TV show requests",
icon="mdi:television-classic",
),
SensorEntityDescription(
key="music",
name="Music album requests",
icon="mdi:album",
),
SensorEntityDescription(
key="pending",
name="Pending requests",
icon="mdi:clock-alert-outline",
),
SensorEntityDescription(
key="approved",
name="Approved requests",
icon="mdi:check",
),
SensorEntityDescription(
key="available",
name="Available requests",
icon="mdi:download",
),
)

View File

@ -11,13 +11,47 @@ from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
from .const import DOMAIN, SENSOR_TYPES from .const import DOMAIN
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
SCAN_INTERVAL = timedelta(seconds=60) SCAN_INTERVAL = timedelta(seconds=60)
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
SensorEntityDescription(
key="movies",
name="Movie requests",
icon="mdi:movie",
),
SensorEntityDescription(
key="tv",
name="TV show requests",
icon="mdi:television-classic",
),
SensorEntityDescription(
key="music",
name="Music album requests",
icon="mdi:album",
),
SensorEntityDescription(
key="pending",
name="Pending requests",
icon="mdi:clock-alert-outline",
),
SensorEntityDescription(
key="approved",
name="Approved requests",
icon="mdi:check",
),
SensorEntityDescription(
key="available",
name="Available requests",
icon="mdi:download",
),
)
def setup_platform( def setup_platform(
hass: HomeAssistant, hass: HomeAssistant,
config: ConfigType, config: ConfigType,