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 2017-03-19 21:02:11 +00:00 committed by Pascal Vizeli
parent 970bde9e99
commit acf75b5253
12 changed files with 50 additions and 49 deletions

View file

@ -94,15 +94,15 @@ class TestMfiSwitch(unittest.TestCase):
self.assertEqual(self.port.control.call_args, mock.call(False))
self.assertFalse(self.switch._target_state)
def test_current_power_mwh(self):
def test_current_power_w(self):
"""Test current power."""
self.port.data = {'active_pwr': 1}
self.assertEqual(1000, self.switch.current_power_mwh)
self.port.data = {'active_pwr': 10}
self.assertEqual(10, self.switch.current_power_w)
def test_current_power_mwh_no_data(self):
def test_current_power_w_no_data(self):
"""Test current power if there is no data."""
self.port.data = {'notpower': 123}
self.assertEqual(0, self.switch.current_power_mwh)
self.assertEqual(0, self.switch.current_power_w)
def test_device_state_attributes(self):
"""Test the state attributes."""