mirror of
https://github.com/home-assistant/core.git
synced 2025-08-04 05:05:09 +02:00
fix pep8 errors and typos in tests.
This commit is contained in:
@@ -211,7 +211,6 @@ class MqttLight(Light):
|
|||||||
def color_temp(self):
|
def color_temp(self):
|
||||||
return self._color_temp
|
return self._color_temp
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
"""No polling needed for a MQTT light."""
|
"""No polling needed for a MQTT light."""
|
||||||
|
@@ -186,9 +186,9 @@ class TestLightMQTT(unittest.TestCase):
|
|||||||
self.assertEqual(100,
|
self.assertEqual(100,
|
||||||
light_state.attributes['brightness'])
|
light_state.attributes['brightness'])
|
||||||
|
|
||||||
fire_mqtt_message(self.hass, 'test_lgith_rgb/color_temp/status', '300')
|
fire_mqtt_message(self.hass, 'test_light_rgb/color_temp/status', '300')
|
||||||
self.hass.block_till_done()
|
self.hass.block_till_done()
|
||||||
light_state = self.hass.states.get('light-test')
|
light_state = self.hass.states.get('light.test')
|
||||||
self.hass.block_till_done()
|
self.hass.block_till_done()
|
||||||
self.assertEqual(300, light_state.attributes['color_temp'])
|
self.assertEqual(300, light_state.attributes['color_temp'])
|
||||||
|
|
||||||
@@ -260,6 +260,7 @@ class TestLightMQTT(unittest.TestCase):
|
|||||||
'state_topic': 'test_light_rgb/status',
|
'state_topic': 'test_light_rgb/status',
|
||||||
'command_topic': 'test_light_rgb/set',
|
'command_topic': 'test_light_rgb/set',
|
||||||
'brightness_state_topic': 'test_light_rgb/brightness/status',
|
'brightness_state_topic': 'test_light_rgb/brightness/status',
|
||||||
|
'color_temp_state_topic': 'test_light_rgb/color_temp/status',
|
||||||
'rgb_state_topic': 'test_light_rgb/rgb/status',
|
'rgb_state_topic': 'test_light_rgb/rgb/status',
|
||||||
'state_value_template': '{{ value_json.hello }}',
|
'state_value_template': '{{ value_json.hello }}',
|
||||||
'brightness_value_template': '{{ value_json.hello }}',
|
'brightness_value_template': '{{ value_json.hello }}',
|
||||||
@@ -280,7 +281,7 @@ class TestLightMQTT(unittest.TestCase):
|
|||||||
fire_mqtt_message(self.hass, 'test_light_rgb/brightness/status',
|
fire_mqtt_message(self.hass, 'test_light_rgb/brightness/status',
|
||||||
'{"hello": "50"}')
|
'{"hello": "50"}')
|
||||||
fire_mqtt_message(self.hass, 'test_light_rgb/color_temp/status',
|
fire_mqtt_message(self.hass, 'test_light_rgb/color_temp/status',
|
||||||
'{"hello": "300}')
|
'{"hello": "300"}')
|
||||||
self.hass.block_till_done()
|
self.hass.block_till_done()
|
||||||
|
|
||||||
state = self.hass.states.get('light.test')
|
state = self.hass.states.get('light.test')
|
||||||
@@ -377,7 +378,7 @@ class TestLightMQTT(unittest.TestCase):
|
|||||||
"""Test the color temp only if a command topic is present."""
|
"""Test the color temp only if a command topic is present."""
|
||||||
self.hass.config.components = ['mqtt']
|
self.hass.config.components = ['mqtt']
|
||||||
assert _setup_component(self.hass, light.DOMAIN, {
|
assert _setup_component(self.hass, light.DOMAIN, {
|
||||||
light.DOMAIN:{
|
light.DOMAIN: {
|
||||||
'platform': 'mqtt',
|
'platform': 'mqtt',
|
||||||
'name': 'test',
|
'name': 'test',
|
||||||
'color_temp_command_topic': 'test_light_rgb/brightness/set',
|
'color_temp_command_topic': 'test_light_rgb/brightness/set',
|
||||||
|
Reference in New Issue
Block a user