Utility meter (#19718)
* initial commit * test service calls * lint * float -> Decimal * extra tests * lint * lint * lint * lint * fix self reset * clean * add services * improve service example description * add optional paused initialization * fix * travis fix * fix YEARLY * add tests for previous bug * address comments and suggestions from @ottowinter * lint * remove debug * add discoverability capabilities * no need for _hass * Update homeassistant/components/sensor/utility_meter.py Co-Authored-By: dgomes <diogogomes@gmail.com> * Update homeassistant/components/sensor/utility_meter.py Co-Authored-By: dgomes <diogogomes@gmail.com> * correct comment * improve error handling * address @MartinHjelmare comments * address @MartinHjelmare comments * one patch is enought * follow @ballob suggestion in https://github.com/home-assistant/architecture/issues/131 * fix tests * review fixes * major refactor * lint * lint * address comments by @MartinHjelmare * rename variable
This commit is contained in:
parent
ed6e349515
commit
1d5ffe9ad5
7 changed files with 713 additions and 0 deletions
30
homeassistant/components/utility_meter/const.py
Normal file
30
homeassistant/components/utility_meter/const.py
Normal file
|
@ -0,0 +1,30 @@
|
|||
"""Constants for the utility meter component."""
|
||||
DOMAIN = 'utility_meter'
|
||||
|
||||
HOURLY = 'hourly'
|
||||
DAILY = 'daily'
|
||||
WEEKLY = 'weekly'
|
||||
MONTHLY = 'monthly'
|
||||
YEARLY = 'yearly'
|
||||
|
||||
METER_TYPES = [HOURLY, DAILY, WEEKLY, MONTHLY, YEARLY]
|
||||
|
||||
DATA_UTILITY = 'utility_meter_data'
|
||||
|
||||
CONF_METER = 'meter'
|
||||
CONF_SOURCE_SENSOR = 'source'
|
||||
CONF_METER_TYPE = 'cycle'
|
||||
CONF_METER_OFFSET = 'offset'
|
||||
CONF_PAUSED = 'paused'
|
||||
CONF_TARIFFS = 'tariffs'
|
||||
CONF_TARIFF = 'tariff'
|
||||
CONF_TARIFF_ENTITY = 'tariff_entity'
|
||||
|
||||
ATTR_TARIFF = 'tariff'
|
||||
|
||||
SIGNAL_START_PAUSE_METER = 'utility_meter_start_pause'
|
||||
SIGNAL_RESET_METER = 'utility_meter_reset'
|
||||
|
||||
SERVICE_RESET = 'reset'
|
||||
SERVICE_SELECT_TARIFF = 'select_tariff'
|
||||
SERVICE_SELECT_NEXT_TARIFF = 'next_tariff'
|
Loading…
Add table
Add a link
Reference in a new issue