mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Clean up tellduslive constants (#49765)
This commit is contained in:
parent
d2d80093a1
commit
b5cb9e4ade
@ -7,13 +7,12 @@ from tellduslive import DIM, TURNON, UP, Session
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.const import CONF_SCAN_INTERVAL
|
from homeassistant.const import CONF_HOST, CONF_SCAN_INTERVAL
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
from homeassistant.helpers.dispatcher import async_dispatcher_send
|
||||||
from homeassistant.helpers.event import async_call_later
|
from homeassistant.helpers.event import async_call_later
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
CONF_HOST,
|
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
KEY_SCAN_INTERVAL,
|
KEY_SCAN_INTERVAL,
|
||||||
KEY_SESSION,
|
KEY_SESSION,
|
||||||
@ -52,7 +51,6 @@ INTERVAL_TRACKER = f"{DOMAIN}_INTERVAL"
|
|||||||
|
|
||||||
async def async_setup_entry(hass, entry):
|
async def async_setup_entry(hass, entry):
|
||||||
"""Create a tellduslive session."""
|
"""Create a tellduslive session."""
|
||||||
|
|
||||||
conf = entry.data[KEY_SESSION]
|
conf = entry.data[KEY_SESSION]
|
||||||
|
|
||||||
if CONF_HOST in conf:
|
if CONF_HOST in conf:
|
||||||
|
@ -1,13 +1,6 @@
|
|||||||
"""Consts used by TelldusLive."""
|
"""Consts used by TelldusLive."""
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
|
||||||
from homeassistant.const import ( # noqa: F401 pylint: disable=unused-import
|
|
||||||
ATTR_BATTERY_LEVEL,
|
|
||||||
CONF_HOST,
|
|
||||||
CONF_TOKEN,
|
|
||||||
DEVICE_DEFAULT_NAME,
|
|
||||||
)
|
|
||||||
|
|
||||||
APPLICATION_NAME = "Home Assistant"
|
APPLICATION_NAME = "Home Assistant"
|
||||||
|
|
||||||
DOMAIN = "tellduslive"
|
DOMAIN = "tellduslive"
|
||||||
|
@ -93,7 +93,6 @@ class TelldusLiveEntity(Entity):
|
|||||||
@property
|
@property
|
||||||
def _battery_level(self):
|
def _battery_level(self):
|
||||||
"""Return the battery level of a device."""
|
"""Return the battery level of a device."""
|
||||||
|
|
||||||
if self.device.battery == BATTERY_LOW:
|
if self.device.battery == BATTERY_LOW:
|
||||||
return 1
|
return 1
|
||||||
if self.device.battery == BATTERY_UNKNOWN:
|
if self.device.battery == BATTERY_UNKNOWN:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user