mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Move lastfm constants to separate file (#92289)
This commit is contained in:
parent
ed286fc223
commit
cd52e05075
15
homeassistant/components/lastfm/const.py
Normal file
15
homeassistant/components/lastfm/const.py
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
"""Constants for LastFM."""
|
||||||
|
import logging
|
||||||
|
from typing import Final
|
||||||
|
|
||||||
|
LOGGER = logging.getLogger(__package__)
|
||||||
|
DOMAIN: Final = "lastfm"
|
||||||
|
DEFAULT_NAME = "LastFM"
|
||||||
|
|
||||||
|
CONF_USERS = "users"
|
||||||
|
|
||||||
|
ATTR_LAST_PLAYED = "last_played"
|
||||||
|
ATTR_PLAY_COUNT = "play_count"
|
||||||
|
ATTR_TOP_PLAYED = "top_played"
|
||||||
|
|
||||||
|
STATE_NOT_SCROBBLING = "Not Scrobbling"
|
@ -2,7 +2,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import logging
|
|
||||||
|
|
||||||
from pylast import LastFMNetwork, Track, User, WSError
|
from pylast import LastFMNetwork, Track, User, WSError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
@ -14,15 +13,14 @@ import homeassistant.helpers.config_validation as cv
|
|||||||
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
|
||||||
|
|
||||||
LOGGER = logging.getLogger(__name__)
|
from .const import (
|
||||||
|
ATTR_LAST_PLAYED,
|
||||||
CONF_USERS = "users"
|
ATTR_PLAY_COUNT,
|
||||||
|
ATTR_TOP_PLAYED,
|
||||||
ATTR_LAST_PLAYED = "last_played"
|
CONF_USERS,
|
||||||
ATTR_PLAY_COUNT = "play_count"
|
LOGGER,
|
||||||
ATTR_TOP_PLAYED = "top_played"
|
STATE_NOT_SCROBBLING,
|
||||||
|
)
|
||||||
STATE_NOT_SCROBBLING = "Not Scrobbling"
|
|
||||||
|
|
||||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,7 @@ from pylast import Track
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components import sensor
|
from homeassistant.components import sensor
|
||||||
from homeassistant.components.lastfm.sensor import STATE_NOT_SCROBBLING
|
from homeassistant.components.lastfm.const import STATE_NOT_SCROBBLING
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.setup import async_setup_component
|
from homeassistant.setup import async_setup_component
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user