hass-core/homeassistant/components/flume/const.py
Chris Mandich ae8a38757a
Update PyFlume version, support for multiple state attributes (#38138)
* Update PyFlume version, support for multiple state attributes

* Update PyFlume to resolve issue https://github.com/ChrisMandich/PyFlume/issues/7

* Update PyFlume package to 0.5.2, flatten values in sensor

* Delete setup

* Remove 'current_interval' from attributes and round values to 1 decimal place.

* Add missing brackets to remove 'current_interval' from attributes

* Set attribute keys explicitly, check attribute format.

* Breakout intervals into separate sensors.

* Update 'unit_of_measurement' for each sensor, update sensor 'available', remove unusued variables

* Update "Device unique ID."

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* Update PyFlume, resolve API query update for request.

* Cleanup debug logging

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-07-27 21:30:38 -10:00

32 lines
1 KiB
Python

"""The Flume component."""
DOMAIN = "flume"
PLATFORMS = ["sensor"]
DEFAULT_NAME = "Flume Sensor"
FLUME_TYPE_SENSOR = 2
FLUME_QUERIES_SENSOR = {
"current_interval": {"friendly_name": "Current", "unit_of_measurement": "gal/m"},
"month_to_date": {"friendly_name": "Current Month", "unit_of_measurement": "gal"},
"week_to_date": {"friendly_name": "Current Week", "unit_of_measurement": "gal"},
"today": {"friendly_name": "Current Day", "unit_of_measurement": "gal"},
"last_60_min": {"friendly_name": "60 Minutes", "unit_of_measurement": "gal/h"},
"last_24_hrs": {"friendly_name": "24 Hours", "unit_of_measurement": "gal/d"},
"last_30_days": {"friendly_name": "30 Days", "unit_of_measurement": "gal/mo"},
}
FLUME_AUTH = "flume_auth"
FLUME_HTTP_SESSION = "http_session"
FLUME_DEVICES = "devices"
CONF_TOKEN_FILE = "token_filename"
BASE_TOKEN_FILENAME = "FLUME_TOKEN_FILE"
KEY_DEVICE_TYPE = "type"
KEY_DEVICE_ID = "id"
KEY_DEVICE_LOCATION = "location"
KEY_DEVICE_LOCATION_NAME = "name"
KEY_DEVICE_LOCATION_TIMEZONE = "tz"