Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 26 additions & 22 deletions homeassistant/components/sensor/hydroquebec.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.const import (
CONF_USERNAME, CONF_PASSWORD,
CONF_NAME, CONF_MONITORED_VARIABLES)
CONF_NAME, CONF_MONITORED_VARIABLES, TEMP_CELSIUS)
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['pyhydroquebec==1.0.0']
REQUIREMENTS = ['pyhydroquebec==1.1.0']

_LOGGER = logging.getLogger(__name__)

Expand All @@ -36,28 +36,32 @@
MIN_TIME_BETWEEN_UPDATES = timedelta(hours=1)

SENSOR_TYPES = {
'period_total_bill': ['Current period bill',
PRICE, 'mdi:square-inc-cash'],
'period_length': ['Current period length',
DAYS, 'mdi:calendar-today'],
'period_total_days': ['Total number of days in this period',
DAYS, 'mdi:calendar-today'],
'period_mean_daily_bill': ['Period daily average bill',
PRICE, 'mdi:square-inc-cash'],
'period_mean_daily_consumption': ['Period daily average consumption',
KILOWATT_HOUR, 'mdi:flash'],
'period_total_consumption': ['Total Consumption',
KILOWATT_HOUR, 'mdi:flash'],
'period_lower_price_consumption': ['Period Lower price consumption',
KILOWATT_HOUR, 'mdi:flash'],
'period_higher_price_consumption': ['Period Higher price consumption',
KILOWATT_HOUR, 'mdi:flash'],
'yesterday_total_consumption': ['Yesterday total consumption',
KILOWATT_HOUR, 'mdi:flash'],
'yesterday_lower_price_consumption': ['Yesterday lower price consumption',
KILOWATT_HOUR, 'mdi:flash'],
'period_total_bill':
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

['Current period bill', PRICE, 'mdi:square-inc-cash'],
'period_length':
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

['Current period length', DAYS, 'mdi:calendar-today'],
'period_total_days':
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

['Total number of days in this period', DAYS, 'mdi:calendar-today'],
'period_mean_daily_bill':
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

['Period daily average bill', PRICE, 'mdi:square-inc-cash'],
'period_mean_daily_consumption':
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

['Period daily average consumption', KILOWATT_HOUR, 'mdi:flash'],
'period_total_consumption':
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trailing whitespace

['Total Consumption', KILOWATT_HOUR, 'mdi:flash'],
'period_lower_price_consumption':
['Period Lower price consumption', KILOWATT_HOUR, 'mdi:flash'],
'period_higher_price_consumption':
['Period Higher price consumption', KILOWATT_HOUR, 'mdi:flash'],
'yesterday_total_consumption':
['Yesterday total consumption', KILOWATT_HOUR, 'mdi:flash'],
'yesterday_lower_price_consumption':
['Yesterday lower price consumption', KILOWATT_HOUR, 'mdi:flash'],
'yesterday_higher_price_consumption':
['Yesterday higher price consumption', KILOWATT_HOUR, 'mdi:flash'],
'yesterday_average_temperature':
['Yesterday average temperature', TEMP_CELSIUS, 'mdi:thermometer'],
'period_average_temperature':
['Period average temperature', TEMP_CELSIUS, 'mdi:thermometer'],
}

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ pyhik==0.1.0
pyhomematic==0.1.24

# homeassistant.components.sensor.hydroquebec
pyhydroquebec==1.0.0
pyhydroquebec==1.1.0

# homeassistant.components.device_tracker.icloud
pyicloud==0.9.1
Expand Down