Revise power and energy units and property names. (#6212)

* Revise power and energy units and property names.

* Add change for new wemo parameter.
This commit is contained in:
Greg Dowling authored and Pascal Vizeli committed 2017-03-19 22:02:11 +01:00
1 parent 970bde9e99
commit acf75b5253
12 files changed
+50 -49

No files matched your search

+8 -8
View File
@@ -30,14 +30,14 @@ ENTITY_ID_ALL_SWITCHES = group.ENTITY_ID_FORMAT.format('all_switches')
ENTITY_ID_FORMAT = DOMAIN + '.{}'
ATTR_TODAY_MWH = "today_mwh"
ATTR_CURRENT_POWER_MWH = "current_power_mwh"
ATTR_TODAY_ENERGY_KWH = "today_energy_kwh"
ATTR_CURRRENT_POWER_W = "current_power_w"
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10)
PROP_TO_ATTR = {
'current_power_mwh': ATTR_CURRENT_POWER_MWH,
'today_power_mw': ATTR_TODAY_MWH,
'current_power_w': ATTR_CURRRENT_POWER_W,
'today_energy_kwh': ATTR_TODAY_ENERGY_KWH,
}
SWITCH_SERVICE_SCHEMA = vol.Schema({
@@ -144,13 +144,13 @@ class SwitchDevice(ToggleEntity):
# pylint: disable=no-self-use
@property
def current_power_mwh(self):
"""Return the current power usage in mWh."""
def current_power_w(self):
"""Return the current power usage in W."""
return None
@property
def today_power_mw(self):
"""Return the today total power usage in mW."""
def today_energy_kwh(self):
"""Return the today total energy usage in kWh."""
return None
@property