Device Registry (#15980)
* First draft * Generate device id * No obscure registry * Dont store config_entry_id in device * Storage * Small mistake on rebase * Do storage more like entity registry * Improve device identification * Add tests * Remove deconz device support from PR * Fix hound comments, voff! * Fix comments and clean up * Fix proper indentation * Fix pydoc issues * Fix mochad component to not use self.device * Fix mochad light platform to not use self.device * Fix TankUtilitySensor to not use self.device * Fix Soundtouch to not use self.device * Fix Plex to not use self.device * Fix Emby to not use self.device * Fix Heatmiser to not use self.device * Fix Wemo lights to not use self.device * Fix Lifx to not use self.device * Fix Radiotherm to not use self.device * Fix Juicenet to not use self.device * Fix Qwikswitch to not use self.device * Fix Xiaomi miio to not use self.device * Fix Nest to not use self.device * Fix Tellduslive to not use self.device * Fix Knx to not use self.device * Clean up a small mistake in soundtouch * Fix comment from Ballob * Fix bad indentation * Fix indentatin * Lint * Remove unused variable * Lint
This commit is contained in:
1 parent
7e7f9bc6ac
commit
0009be595c
40 files changed
+538
-331
No files matched your search
@@ -76,18 +76,18 @@ class TestMochadLight(unittest.TestCase):
|
||||
def test_turn_on_with_no_brightness(self):
|
||||
"""Test turn_on."""
|
||||
self.light.turn_on()
|
||||
self.light.device.send_cmd.assert_called_once_with('on')
|
||||
self.light.light.send_cmd.assert_called_once_with('on')
|
||||
|
||||
def test_turn_on_with_brightness(self):
|
||||
"""Test turn_on."""
|
||||
self.light.turn_on(brightness=45)
|
||||
self.light.device.send_cmd.assert_has_calls(
|
||||
self.light.light.send_cmd.assert_has_calls(
|
||||
[mock.call('on'), mock.call('dim 25')])
|
||||
|
||||
def test_turn_off(self):
|
||||
"""Test turn_off."""
|
||||
self.light.turn_off()
|
||||
self.light.device.send_cmd.assert_called_once_with('off')
|
||||
self.light.light.send_cmd.assert_called_once_with('off')
|
||||
|
||||
|
||||
class TestMochadLight256Levels(unittest.TestCase):
|
||||
@@ -109,17 +109,17 @@ class TestMochadLight256Levels(unittest.TestCase):
|
||||
def test_turn_on_with_no_brightness(self):
|
||||
"""Test turn_on."""
|
||||
self.light.turn_on()
|
||||
self.light.device.send_cmd.assert_called_once_with('xdim 255')
|
||||
self.light.light.send_cmd.assert_called_once_with('xdim 255')
|
||||
|
||||
def test_turn_on_with_brightness(self):
|
||||
"""Test turn_on."""
|
||||
self.light.turn_on(brightness=45)
|
||||
self.light.device.send_cmd.assert_called_once_with('xdim 45')
|
||||
self.light.light.send_cmd.assert_called_once_with('xdim 45')
|
||||
|
||||
def test_turn_off(self):
|
||||
"""Test turn_off."""
|
||||
self.light.turn_off()
|
||||
self.light.device.send_cmd.assert_called_once_with('off')
|
||||
self.light.light.send_cmd.assert_called_once_with('off')
|
||||
|
||||
|
||||
class TestMochadLight64Levels(unittest.TestCase):
|
||||
@@ -141,14 +141,14 @@ class TestMochadLight64Levels(unittest.TestCase):
|
||||
def test_turn_on_with_no_brightness(self):
|
||||
"""Test turn_on."""
|
||||
self.light.turn_on()
|
||||
self.light.device.send_cmd.assert_called_once_with('xdim 63')
|
||||
self.light.light.send_cmd.assert_called_once_with('xdim 63')
|
||||
|
||||
def test_turn_on_with_brightness(self):
|
||||
"""Test turn_on."""
|
||||
self.light.turn_on(brightness=45)
|
||||
self.light.device.send_cmd.assert_called_once_with('xdim 11')
|
||||
self.light.light.send_cmd.assert_called_once_with('xdim 11')
|
||||
|
||||
def test_turn_off(self):
|
||||
"""Test turn_off."""
|
||||
self.light.turn_off()
|
||||
self.light.device.send_cmd.assert_called_once_with('off')
|
||||
self.light.light.send_cmd.assert_called_once_with('off')
|
||||
Reference in new issue
Block a user