From 52313bfce5ac6f29157cf34eac50c83f244d6e68 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Fri, 21 Jul 2023 11:55:31 +0200 Subject: [PATCH] Clean up Ombi const file (#95541) --- homeassistant/components/ombi/const.py | 35 ------------------------ homeassistant/components/ombi/sensor.py | 36 ++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 36 deletions(-) diff --git a/homeassistant/components/ombi/const.py b/homeassistant/components/ombi/const.py index 3ed67389003..59a57a480c2 100644 --- a/homeassistant/components/ombi/const.py +++ b/homeassistant/components/ombi/const.py @@ -1,8 +1,6 @@ """Support for Ombi.""" from __future__ import annotations -from homeassistant.components.sensor import SensorEntityDescription - ATTR_SEASON = "season" CONF_URLBASE = "urlbase" @@ -16,36 +14,3 @@ DEFAULT_URLBASE = "" SERVICE_MOVIE_REQUEST = "submit_movie_request" SERVICE_MUSIC_REQUEST = "submit_music_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", - ), -) diff --git a/homeassistant/components/ombi/sensor.py b/homeassistant/components/ombi/sensor.py index 1ab4b170e00..f534144d02c 100644 --- a/homeassistant/components/ombi/sensor.py +++ b/homeassistant/components/ombi/sensor.py @@ -11,13 +11,47 @@ from homeassistant.core import HomeAssistant from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType -from .const import DOMAIN, SENSOR_TYPES +from .const import DOMAIN _LOGGER = logging.getLogger(__name__) 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( hass: HomeAssistant, config: ConfigType,