move current_position to RollershutterDevice class
This commit is contained in:
1 parent
e001ea913a
commit
351430c1b3
3 files changed
+47
-28
No files matched your search
@@ -93,9 +93,9 @@ class TestRollershutterMQTT(unittest.TestCase):
|
||||
}
|
||||
}))
|
||||
|
||||
current_position = self.hass.states.get(
|
||||
'rollershutter.test').attributes['current_position']
|
||||
self.assertEqual(-1, current_position)
|
||||
state_attributes_dict = self.hass.states.get(
|
||||
'rollershutter.test').attributes
|
||||
self.assertFalse('current_position' in state_attributes_dict)
|
||||
|
||||
fire_mqtt_message(self.hass, 'state-topic', '0')
|
||||
self.hass.pool.block_till_done()
|
||||
@@ -114,3 +114,9 @@ class TestRollershutterMQTT(unittest.TestCase):
|
||||
current_position = self.hass.states.get(
|
||||
'rollershutter.test').attributes['current_position']
|
||||
self.assertEqual(50, current_position)
|
||||
|
||||
fire_mqtt_message(self.hass, 'state-topic', 'non-numeric')
|
||||
self.hass.pool.block_till_done()
|
||||
current_position = self.hass.states.get(
|
||||
'rollershutter.test').attributes['current_position']
|
||||
self.assertEqual(50, current_position)
|
||||
Reference in new issue
Block a user