Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move 'voltage' to const #9621

Merged
merged 1 commit into from
Sep 29, 2017
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
Move 'voltage' to const
  • Loading branch information
fabaff committed Sep 29, 2017
commit b920097c6a7f89e2641d25d24b3945cded691953
4 changes: 2 additions & 2 deletions homeassistant/components/sensor/pvoutput.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
from homeassistant.components.sensor import PLATFORM_SCHEMA
from homeassistant.components.sensor.rest import RestData
from homeassistant.const import (
ATTR_TEMPERATURE, CONF_API_KEY, CONF_NAME, ATTR_DATE, ATTR_TIME)
ATTR_TEMPERATURE, CONF_API_KEY, CONF_NAME, ATTR_DATE, ATTR_TIME,
ATTR_VOLTAGE)

_LOGGER = logging.getLogger(__name__)
_ENDPOINT = 'http://pvoutput.org/service/r2/getstatus.jsp'
Expand All @@ -25,7 +26,6 @@
ATTR_ENERGY_CONSUMPTION = 'energy_consumption'
ATTR_POWER_CONSUMPTION = 'power_consumption'
ATTR_EFFICIENCY = 'efficiency'
ATTR_VOLTAGE = 'voltage'

CONF_SYSTEM_ID = 'system_id'

Expand Down
3 changes: 1 addition & 2 deletions homeassistant/components/switch/tplink.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import voluptuous as vol

from homeassistant.components.switch import (SwitchDevice, PLATFORM_SCHEMA)
from homeassistant.const import (CONF_HOST, CONF_NAME)
from homeassistant.const import (CONF_HOST, CONF_NAME, ATTR_VOLTAGE)
import homeassistant.helpers.config_validation as cv

REQUIREMENTS = ['pyHS100==0.2.4.2']
Expand All @@ -21,7 +21,6 @@
ATTR_CURRENT_CONSUMPTION = 'current_consumption'
ATTR_TOTAL_CONSUMPTION = 'total_consumption'
ATTR_DAILY_CONSUMPTION = 'daily_consumption'
ATTR_VOLTAGE = 'voltage'
ATTR_CURRENT = 'current'

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
Expand Down
3 changes: 3 additions & 0 deletions homeassistant/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@
CONF_UNIT_SYSTEM_METRIC = 'metric' # type: str
CONF_UNIT_SYSTEM_IMPERIAL = 'imperial' # type: str

# Electrical attributes
ATTR_VOLTAGE = 'voltage'

# Temperature attribute
ATTR_TEMPERATURE = 'temperature'
TEMP_CELSIUS = '°C'
Expand Down