mirror of
https://github.com/home-assistant/core.git
synced 2025-04-24 09:17:53 +00:00
Move constant to 'const.py' and use already defined ones (#10211)
This commit is contained in:
parent
6a9968ccb9
commit
690760404b
@ -12,13 +12,12 @@ import voluptuous as vol
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.notify import (
|
||||
PLATFORM_SCHEMA, BaseNotificationService, ATTR_TARGET)
|
||||
from homeassistant.const import CONF_TOKEN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
REQUIREMENTS = ['discord.py==0.16.12']
|
||||
|
||||
CONF_TOKEN = 'token'
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_TOKEN): cv.string
|
||||
})
|
||||
|
@ -8,14 +8,14 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components import ecobee
|
||||
from homeassistant.components.notify import (
|
||||
BaseNotificationService, PLATFORM_SCHEMA) # NOQA
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
DEPENDENCIES = ['ecobee']
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
DEPENDENCIES = ['ecobee']
|
||||
|
||||
CONF_INDEX = 'index'
|
||||
|
||||
|
@ -11,14 +11,13 @@ import voluptuous as vol
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TARGET, ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
from homeassistant.const import CONF_TOKEN, CONF_HOST
|
||||
from homeassistant.const import CONF_TOKEN, CONF_HOST, CONF_ROOM
|
||||
|
||||
REQUIREMENTS = ['hipnotify==1.0.8']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_COLOR = 'color'
|
||||
CONF_ROOM = 'room'
|
||||
CONF_NOTIFY = 'notify'
|
||||
CONF_FORMAT = 'format'
|
||||
|
||||
|
@ -8,17 +8,14 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.const import (
|
||||
CONF_URL, CONF_USERNAME, CONF_PASSWORD)
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, PLATFORM_SCHEMA,
|
||||
BaseNotificationService)
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import (
|
||||
CONF_URL, CONF_USERNAME, CONF_PASSWORD, CONF_ROOM)
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_DATA, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
|
||||
REQUIREMENTS = ['rocketchat-API==0.6.1']
|
||||
|
||||
CONF_ROOM = 'room'
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
# pylint: disable=no-value-for-parameter
|
||||
@ -44,11 +41,11 @@ def get_service(hass, config, discovery_info=None):
|
||||
return RocketChatNotificationService(url, username, password, room)
|
||||
except RocketConnectionException:
|
||||
_LOGGER.warning(
|
||||
"Unable to connect to Rocket.Chat server at %s.", url)
|
||||
"Unable to connect to Rocket.Chat server at %s", url)
|
||||
except RocketAuthenticationException:
|
||||
_LOGGER.warning(
|
||||
"Rocket.Chat authentication failed for user %s.", username)
|
||||
_LOGGER.info("Please check your username/password.")
|
||||
"Rocket.Chat authentication failed for user %s", username)
|
||||
_LOGGER.info("Please check your username/password")
|
||||
|
||||
return None
|
||||
|
||||
@ -65,8 +62,8 @@ class RocketChatNotificationService(BaseNotificationService):
|
||||
def send_message(self, message="", **kwargs):
|
||||
"""Send a message to Rocket.Chat."""
|
||||
data = kwargs.get(ATTR_DATA) or {}
|
||||
resp = self._server.chat_post_message(message, channel=self._room,
|
||||
**data)
|
||||
resp = self._server.chat_post_message(
|
||||
message, channel=self._room, **data)
|
||||
if resp.status_code == 200:
|
||||
success = resp.json()["success"]
|
||||
if not success:
|
||||
|
@ -11,7 +11,8 @@ import voluptuous as vol
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.notify import (
|
||||
ATTR_TITLE, ATTR_TITLE_DEFAULT, PLATFORM_SCHEMA, BaseNotificationService)
|
||||
from homeassistant.const import CONF_PASSWORD, CONF_SENDER, CONF_RECIPIENT
|
||||
from homeassistant.const import (
|
||||
CONF_PASSWORD, CONF_SENDER, CONF_RECIPIENT, CONF_ROOM)
|
||||
|
||||
REQUIREMENTS = ['sleekxmpp==1.3.2',
|
||||
'dnspython3==1.15.0',
|
||||
@ -22,7 +23,6 @@ _LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_TLS = 'tls'
|
||||
CONF_VERIFY = 'verify'
|
||||
CONF_ROOM = 'room'
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_SENDER): cv.string,
|
||||
|
@ -14,7 +14,7 @@ from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_API_KEY,
|
||||
CONF_LATITUDE, CONF_LONGITUDE, CONF_MONITORED_CONDITIONS, CONF_STATE,
|
||||
CONF_SHOW_ON_MAP)
|
||||
CONF_SHOW_ON_MAP, CONF_RADIUS)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
@ -31,7 +31,6 @@ ATTR_TIMESTAMP = 'timestamp'
|
||||
|
||||
CONF_CITY = 'city'
|
||||
CONF_COUNTRY = 'country'
|
||||
CONF_RADIUS = 'radius'
|
||||
CONF_ATTRIBUTION = "Data provided by AirVisual"
|
||||
|
||||
MASS_PARTS_PER_MILLION = 'ppm'
|
||||
|
@ -12,46 +12,50 @@ import aiohttp
|
||||
import async_timeout
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE,
|
||||
CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS,
|
||||
ATTR_ATTRIBUTION, ATTR_LOCATION, ATTR_LATITUDE, ATTR_LONGITUDE,
|
||||
ATTR_FRIENDLY_NAME, STATE_UNKNOWN, LENGTH_METERS, LENGTH_FEET)
|
||||
ATTR_FRIENDLY_NAME, STATE_UNKNOWN, LENGTH_METERS, LENGTH_FEET,
|
||||
ATTR_ID)
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.util import location, distance
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ATTR_EMPTY_SLOTS = 'empty_slots'
|
||||
ATTR_EXTRA = 'extra'
|
||||
ATTR_FREE_BIKES = 'free_bikes'
|
||||
ATTR_NAME = 'name'
|
||||
ATTR_NETWORK = 'network'
|
||||
ATTR_NETWORKS_LIST = 'networks'
|
||||
ATTR_STATIONS_LIST = 'stations'
|
||||
ATTR_TIMESTAMP = 'timestamp'
|
||||
ATTR_UID = 'uid'
|
||||
|
||||
CONF_NETWORK = 'network'
|
||||
CONF_STATIONS_LIST = 'stations'
|
||||
|
||||
DEFAULT_ENDPOINT = 'https://api.citybik.es/{uri}'
|
||||
DOMAIN = 'citybikes'
|
||||
|
||||
MONITORED_NETWORKS = 'monitored-networks'
|
||||
|
||||
NETWORKS_URI = 'v2/networks'
|
||||
STATIONS_URI = 'v2/networks/{uid}?fields=network.stations'
|
||||
|
||||
REQUEST_TIMEOUT = 5 # In seconds; argument to asyncio.timeout
|
||||
|
||||
SCAN_INTERVAL = timedelta(minutes=5) # Timely, and doesn't suffocate the API
|
||||
DOMAIN = 'citybikes'
|
||||
MONITORED_NETWORKS = 'monitored-networks'
|
||||
CONF_NETWORK = 'network'
|
||||
CONF_RADIUS = 'radius'
|
||||
CONF_STATIONS_LIST = 'stations'
|
||||
ATTR_NETWORKS_LIST = 'networks'
|
||||
ATTR_NETWORK = 'network'
|
||||
ATTR_STATIONS_LIST = 'stations'
|
||||
ATTR_ID = 'id'
|
||||
ATTR_UID = 'uid'
|
||||
ATTR_NAME = 'name'
|
||||
ATTR_EXTRA = 'extra'
|
||||
ATTR_TIMESTAMP = 'timestamp'
|
||||
ATTR_EMPTY_SLOTS = 'empty_slots'
|
||||
ATTR_FREE_BIKES = 'free_bikes'
|
||||
ATTR_TIMESTAMP = 'timestamp'
|
||||
|
||||
STATIONS_URI = 'v2/networks/{uid}?fields=network.stations'
|
||||
|
||||
CITYBIKES_ATTRIBUTION = "Information provided by the CityBikes Project "\
|
||||
"(https://citybik.es/#about)"
|
||||
|
||||
|
||||
PLATFORM_SCHEMA = vol.All(
|
||||
cv.has_at_least_one_key(CONF_RADIUS, CONF_STATIONS_LIST),
|
||||
PLATFORM_SCHEMA.extend({
|
||||
@ -61,10 +65,7 @@ PLATFORM_SCHEMA = vol.All(
|
||||
vol.Inclusive(CONF_LONGITUDE, 'coordinates'): cv.longitude,
|
||||
vol.Optional(CONF_RADIUS, 'station_filter'): cv.positive_int,
|
||||
vol.Optional(CONF_STATIONS_LIST, 'station_filter'):
|
||||
vol.All(
|
||||
cv.ensure_list,
|
||||
vol.Length(min=1),
|
||||
[cv.string])
|
||||
vol.All(cv.ensure_list, vol.Length(min=1), [cv.string])
|
||||
}))
|
||||
|
||||
NETWORK_SCHEMA = vol.Schema({
|
||||
@ -88,9 +89,8 @@ STATION_SCHEMA = vol.Schema({
|
||||
vol.Required(ATTR_ID): cv.string,
|
||||
vol.Required(ATTR_NAME): cv.string,
|
||||
vol.Required(ATTR_TIMESTAMP): cv.string,
|
||||
vol.Optional(ATTR_EXTRA): vol.Schema({
|
||||
vol.Optional(ATTR_UID): cv.string
|
||||
}, extra=vol.REMOVE_EXTRA)
|
||||
vol.Optional(ATTR_EXTRA):
|
||||
vol.Schema({vol.Optional(ATTR_UID): cv.string}, extra=vol.REMOVE_EXTRA)
|
||||
}, extra=vol.REMOVE_EXTRA)
|
||||
|
||||
STATIONS_RESPONSE_SCHEMA = vol.Schema({
|
||||
|
@ -13,7 +13,7 @@ import voluptuous as vol
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
CONF_INCLUDE, CONF_EXCLUDE, CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE,
|
||||
ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE,
|
||||
ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_RADIUS,
|
||||
LENGTH_KILOMETERS, LENGTH_METERS)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import slugify
|
||||
@ -25,8 +25,6 @@ REQUIREMENTS = ['crimereports==1.0.0']
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
CONF_RADIUS = 'radius'
|
||||
|
||||
DOMAIN = 'crimereports'
|
||||
|
||||
EVENT_INCIDENT = '{}_incident'.format(DOMAIN)
|
||||
@ -58,11 +56,11 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
|
||||
|
||||
class CrimeReportsSensor(Entity):
|
||||
"""Crime Reports Sensor."""
|
||||
"""Representation of a Crime Reports Sensor."""
|
||||
|
||||
def __init__(self, hass, name, latitude, longitude, radius,
|
||||
include, exclude):
|
||||
"""Initialize the sensor."""
|
||||
"""Initialize the Crime Reports sensor."""
|
||||
import crimereports
|
||||
self._hass = hass
|
||||
self._name = name
|
||||
|
@ -8,7 +8,6 @@ and grouped by category.
|
||||
For more details about this platform, please refer to the documentation at
|
||||
https://home-assistant.io/components/sensor.geo_rss_events/
|
||||
"""
|
||||
|
||||
import logging
|
||||
from collections import namedtuple
|
||||
from datetime import timedelta
|
||||
@ -17,8 +16,8 @@ import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (STATE_UNKNOWN, CONF_UNIT_OF_MEASUREMENT,
|
||||
CONF_NAME)
|
||||
from homeassistant.const import (
|
||||
STATE_UNKNOWN, CONF_UNIT_OF_MEASUREMENT, CONF_NAME, CONF_RADIUS, CONF_URL)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import Throttle
|
||||
|
||||
@ -31,8 +30,6 @@ ATTR_DISTANCE = 'distance'
|
||||
ATTR_TITLE = 'title'
|
||||
|
||||
CONF_CATEGORIES = 'categories'
|
||||
CONF_RADIUS = 'radius'
|
||||
CONF_URL = 'url'
|
||||
|
||||
DEFAULT_ICON = 'mdi:alert'
|
||||
DEFAULT_NAME = "Event Service"
|
||||
@ -50,8 +47,8 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
vol.Required(CONF_URL): cv.string,
|
||||
vol.Optional(CONF_RADIUS, default=DEFAULT_RADIUS_IN_KM): vol.Coerce(float),
|
||||
vol.Optional(CONF_NAME, default=DEFAULT_NAME): cv.string,
|
||||
vol.Optional(CONF_CATEGORIES, default=[]): vol.All(cv.ensure_list,
|
||||
[cv.string]),
|
||||
vol.Optional(CONF_CATEGORIES, default=[]):
|
||||
vol.All(cv.ensure_list, [cv.string]),
|
||||
vol.Optional(CONF_UNIT_OF_MEASUREMENT,
|
||||
default=DEFAULT_UNIT_OF_MEASUREMENT): cv.string,
|
||||
})
|
||||
@ -59,7 +56,6 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
"""Set up the GeoRSS component."""
|
||||
# Grab location from config
|
||||
home_latitude = hass.config.latitude
|
||||
home_longitude = hass.config.longitude
|
||||
url = config.get(CONF_URL)
|
||||
@ -154,7 +150,7 @@ class GeoRssServiceSensor(Entity):
|
||||
|
||||
|
||||
class GeoRssServiceData(object):
|
||||
"""Provides access to GeoRSS feed and stores the latest data."""
|
||||
"""Provide access to GeoRSS feed and stores the latest data."""
|
||||
|
||||
def __init__(self, home_latitude, home_longitude, url, radius_in_km):
|
||||
"""Initialize the update service."""
|
||||
|
@ -10,7 +10,7 @@ import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import CONF_NAME, CONF_API_KEY
|
||||
from homeassistant.const import CONF_NAME, CONF_API_KEY, CONF_ROOM
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
REQUIREMENTS = ['gitterpy==0.1.6']
|
||||
@ -21,8 +21,6 @@ ATTR_MENTION = 'mention'
|
||||
ATTR_ROOM = 'room'
|
||||
ATTR_USERNAME = 'username'
|
||||
|
||||
CONF_ROOM = 'room'
|
||||
|
||||
DEFAULT_NAME = 'Gitter messages'
|
||||
DEFAULT_ROOM = 'home-assistant/home-assistant'
|
||||
|
||||
|
@ -11,13 +11,13 @@ from datetime import timedelta
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant.core import callback
|
||||
import homeassistant.components.mqtt as mqtt
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.mqtt import CONF_STATE_TOPIC
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
CONF_NAME, CONF_TIMEOUT, STATE_NOT_HOME)
|
||||
from homeassistant.components.mqtt import CONF_STATE_TOPIC
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
CONF_NAME, CONF_TIMEOUT, STATE_NOT_HOME, ATTR_ID)
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import dt, slugify
|
||||
|
||||
@ -27,16 +27,14 @@ DEPENDENCIES = ['mqtt']
|
||||
|
||||
ATTR_DEVICE_ID = 'device_id'
|
||||
ATTR_DISTANCE = 'distance'
|
||||
ATTR_ID = 'id'
|
||||
ATTR_ROOM = 'room'
|
||||
|
||||
CONF_DEVICE_ID = 'device_id'
|
||||
CONF_ROOM = 'room'
|
||||
CONF_AWAY_TIMEOUT = 'away_timeout'
|
||||
|
||||
DEFAULT_AWAY_TIMEOUT = 0
|
||||
DEFAULT_NAME = 'Room Sensor'
|
||||
DEFAULT_TIMEOUT = 5
|
||||
DEFAULT_AWAY_TIMEOUT = 0
|
||||
DEFAULT_TOPIC = 'room_presence'
|
||||
|
||||
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
|
||||
|
@ -10,27 +10,29 @@ from datetime import timedelta
|
||||
import requests
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.components.sensor import PLATFORM_SCHEMA
|
||||
from homeassistant.const import (
|
||||
CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE,
|
||||
CONF_NAME, CONF_LATITUDE, CONF_LONGITUDE, CONF_RADIUS,
|
||||
ATTR_ATTRIBUTION, ATTR_LATITUDE, ATTR_LONGITUDE,
|
||||
LENGTH_KILOMETERS, LENGTH_METERS)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.util import distance as util_distance
|
||||
from homeassistant.util import location as util_location
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
SCAN_INTERVAL = timedelta(seconds=12) # opensky public limit is 10 seconds
|
||||
DOMAIN = 'opensky'
|
||||
EVENT_OPENSKY_ENTRY = '{}_entry'.format(DOMAIN)
|
||||
EVENT_OPENSKY_EXIT = '{}_exit'.format(DOMAIN)
|
||||
CONF_RADIUS = 'radius'
|
||||
ATTR_CALLSIGN = 'callsign'
|
||||
ATTR_ON_GROUND = 'on_ground'
|
||||
ATTR_SENSOR = 'sensor'
|
||||
ATTR_STATES = 'states'
|
||||
ATTR_ON_GROUND = 'on_ground'
|
||||
ATTR_CALLSIGN = 'callsign'
|
||||
|
||||
DOMAIN = 'opensky'
|
||||
|
||||
EVENT_OPENSKY_ENTRY = '{}_entry'.format(DOMAIN)
|
||||
EVENT_OPENSKY_EXIT = '{}_exit'.format(DOMAIN)
|
||||
SCAN_INTERVAL = timedelta(seconds=12) # opensky public limit is 10 seconds
|
||||
|
||||
OPENSKY_ATTRIBUTION = "Information provided by the OpenSky Network "\
|
||||
"(https://opensky-network.org)"
|
||||
OPENSKY_API_URL = 'https://opensky-network.org/api/states/all'
|
||||
@ -88,7 +90,7 @@ class OpenSkySensor(Entity):
|
||||
for callsign in callsigns:
|
||||
data = {
|
||||
ATTR_CALLSIGN: callsign,
|
||||
ATTR_SENSOR: self._name
|
||||
ATTR_SENSOR: self._name,
|
||||
}
|
||||
self._hass.bus.fire(event, data)
|
||||
|
||||
|
@ -9,12 +9,12 @@ import logging
|
||||
from homeassistant.const import TEMP_CELSIUS
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from homeassistant.components.tado import (DATA_TADO)
|
||||
from homeassistant.const import (ATTR_ID)
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ATTR_DATA_ID = 'data_id'
|
||||
ATTR_DEVICE = 'device'
|
||||
ATTR_ID = 'id'
|
||||
ATTR_NAME = 'name'
|
||||
ATTR_ZONE = 'zone'
|
||||
|
||||
|
@ -9,15 +9,15 @@ import logging
|
||||
|
||||
import voluptuous as vol
|
||||
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.const import (
|
||||
ATTR_HIDDEN, ATTR_LATITUDE, ATTR_LONGITUDE, CONF_NAME, CONF_LATITUDE,
|
||||
CONF_LONGITUDE, CONF_ICON)
|
||||
CONF_LONGITUDE, CONF_ICON, CONF_RADIUS)
|
||||
from homeassistant.loader import bind_hass
|
||||
from homeassistant.helpers import config_per_platform
|
||||
from homeassistant.helpers.entity import Entity, async_generate_entity_id
|
||||
from homeassistant.util.async import run_callback_threadsafe
|
||||
from homeassistant.util.location import distance
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -25,7 +25,6 @@ ATTR_PASSIVE = 'passive'
|
||||
ATTR_RADIUS = 'radius'
|
||||
|
||||
CONF_PASSIVE = 'passive'
|
||||
CONF_RADIUS = 'radius'
|
||||
|
||||
DEFAULT_NAME = 'Unnamed zone'
|
||||
DEFAULT_PASSIVE = False
|
||||
|
@ -140,11 +140,13 @@ CONF_PROFILE_NAME = 'profile_name'
|
||||
CONF_PROTOCOL = 'protocol'
|
||||
CONF_PROXY_SSL = 'proxy_ssl'
|
||||
CONF_QUOTE = 'quote'
|
||||
CONF_RADIUS = 'radius'
|
||||
CONF_RECIPIENT = 'recipient'
|
||||
CONF_REGION = 'region'
|
||||
CONF_RESOURCE = 'resource'
|
||||
CONF_RESOURCES = 'resources'
|
||||
CONF_RGB = 'rgb'
|
||||
CONF_ROOM = 'room'
|
||||
CONF_SCAN_INTERVAL = 'scan_interval'
|
||||
CONF_SENDER = 'sender'
|
||||
CONF_SENSOR_TYPE = 'sensor_type'
|
||||
@ -234,6 +236,9 @@ ATTR_DOMAIN = 'domain'
|
||||
ATTR_SERVICE = 'service'
|
||||
ATTR_SERVICE_DATA = 'service_data'
|
||||
|
||||
# IDs
|
||||
ATTR_ID = 'id'
|
||||
|
||||
# Data for a SERVICE_EXECUTED event
|
||||
ATTR_SERVICE_CALL_ID = 'service_call_id'
|
||||
|
||||
@ -258,38 +263,6 @@ CONF_UNIT_SYSTEM_IMPERIAL = 'imperial' # type: str
|
||||
# Electrical attributes
|
||||
ATTR_VOLTAGE = 'voltage'
|
||||
|
||||
# Temperature attribute
|
||||
ATTR_TEMPERATURE = 'temperature'
|
||||
TEMP_CELSIUS = '°C'
|
||||
TEMP_FAHRENHEIT = '°F'
|
||||
|
||||
# Length units
|
||||
LENGTH_CENTIMETERS = 'cm' # type: str
|
||||
LENGTH_METERS = 'm' # type: str
|
||||
LENGTH_KILOMETERS = 'km' # type: str
|
||||
|
||||
LENGTH_INCHES = 'in' # type: str
|
||||
LENGTH_FEET = 'ft' # type: str
|
||||
LENGTH_YARD = 'yd' # type: str
|
||||
LENGTH_MILES = 'mi' # type: str
|
||||
|
||||
# Volume units
|
||||
VOLUME_LITERS = 'L' # type: str
|
||||
VOLUME_MILLILITERS = 'mL' # type: str
|
||||
|
||||
VOLUME_GALLONS = 'gal' # type: str
|
||||
VOLUME_FLUID_OUNCE = 'fl. oz.' # type: str
|
||||
|
||||
# Mass units
|
||||
MASS_GRAMS = 'g' # type: str
|
||||
MASS_KILOGRAMS = 'kg' # type: str
|
||||
|
||||
MASS_OUNCES = 'oz' # type: str
|
||||
MASS_POUNDS = 'lb' # type: str
|
||||
|
||||
# UV Index units
|
||||
UNIT_UV_INDEX = 'UV index' # type: str
|
||||
|
||||
# Contains the information that is discovered
|
||||
ATTR_DISCOVERED = 'discovered'
|
||||
|
||||
@ -341,6 +314,41 @@ ATTR_SUPPORTED_FEATURES = 'supported_features'
|
||||
# Class of device within its domain
|
||||
ATTR_DEVICE_CLASS = 'device_class'
|
||||
|
||||
# Temperature attribute
|
||||
ATTR_TEMPERATURE = 'temperature'
|
||||
|
||||
# #### UNITS OF MEASUREMENT ####
|
||||
# Temperature units
|
||||
TEMP_CELSIUS = '°C'
|
||||
TEMP_FAHRENHEIT = '°F'
|
||||
|
||||
# Length units
|
||||
LENGTH_CENTIMETERS = 'cm' # type: str
|
||||
LENGTH_METERS = 'm' # type: str
|
||||
LENGTH_KILOMETERS = 'km' # type: str
|
||||
|
||||
LENGTH_INCHES = 'in' # type: str
|
||||
LENGTH_FEET = 'ft' # type: str
|
||||
LENGTH_YARD = 'yd' # type: str
|
||||
LENGTH_MILES = 'mi' # type: str
|
||||
|
||||
# Volume units
|
||||
VOLUME_LITERS = 'L' # type: str
|
||||
VOLUME_MILLILITERS = 'mL' # type: str
|
||||
|
||||
VOLUME_GALLONS = 'gal' # type: str
|
||||
VOLUME_FLUID_OUNCE = 'fl. oz.' # type: str
|
||||
|
||||
# Mass units
|
||||
MASS_GRAMS = 'g' # type: str
|
||||
MASS_KILOGRAMS = 'kg' # type: str
|
||||
|
||||
MASS_OUNCES = 'oz' # type: str
|
||||
MASS_POUNDS = 'lb' # type: str
|
||||
|
||||
# UV Index units
|
||||
UNIT_UV_INDEX = 'UV index' # type: str
|
||||
|
||||
# #### SERVICES ####
|
||||
SERVICE_HOMEASSISTANT_STOP = 'stop'
|
||||
SERVICE_HOMEASSISTANT_RESTART = 'restart'
|
||||
|
Loading…
x
Reference in New Issue
Block a user