Use enums in tractive (#62024)

This commit is contained in:
Robert Hillis 2021-12-16 06:34:01 -05:00 committed by GitHub
parent 087724d2f2
commit ad778f53f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,9 +9,9 @@ from aiotractive.exceptions import TractiveError
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ENTITY_CATEGORY_CONFIG
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import EntityCategory
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import Trackables
@ -50,21 +50,21 @@ SWITCH_TYPES: tuple[TractiveSwitchEntityDescription, ...] = (
name="Tracker Buzzer",
icon="mdi:volume-high",
method="async_set_buzzer",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=EntityCategory.CONFIG,
),
TractiveSwitchEntityDescription(
key=ATTR_LED,
name="Tracker LED",
icon="mdi:led-on",
method="async_set_led",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=EntityCategory.CONFIG,
),
TractiveSwitchEntityDescription(
key=ATTR_LIVE_TRACKING,
name="Live Tracking",
icon="mdi:map-marker-path",
method="async_set_live_tracking",
entity_category=ENTITY_CATEGORY_CONFIG,
entity_category=EntityCategory.CONFIG,
),
)