mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 00:37:53 +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
|
||||
|
||||
import hashlib
|
||||
import logging
|
||||
|
||||
from pylast import LastFMNetwork, Track, User, WSError
|
||||
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.typing import ConfigType, DiscoveryInfoType
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_USERS = "users"
|
||||
|
||||
ATTR_LAST_PLAYED = "last_played"
|
||||
ATTR_PLAY_COUNT = "play_count"
|
||||
ATTR_TOP_PLAYED = "top_played"
|
||||
|
||||
STATE_NOT_SCROBBLING = "Not Scrobbling"
|
||||
from .const import (
|
||||
ATTR_LAST_PLAYED,
|
||||
ATTR_PLAY_COUNT,
|
||||
ATTR_TOP_PLAYED,
|
||||
CONF_USERS,
|
||||
LOGGER,
|
||||
STATE_NOT_SCROBBLING,
|
||||
)
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
|
||||
{
|
||||
|
@ -5,7 +5,7 @@ from pylast import Track
|
||||
import pytest
|
||||
|
||||
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.setup import async_setup_component
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user