Update Homekit to 1.1.9 (#13716)
* Version bump to HAP-python==1.1.9 * Updated types and tests
This commit is contained in:
1 parent
bd51143ac1
commit
85487612d5
14 files changed
+46
-66
No files matched your search
@@ -62,7 +62,7 @@ class TestHomekitSensors(unittest.TestCase):
|
||||
self.assertEqual(acc.char_position_state.value, 2)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_target_position.set_value(25)
|
||||
acc.char_target_position.client_update_value(25)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_SERVICE], 'set_cover_position')
|
||||
@@ -74,7 +74,7 @@ class TestHomekitSensors(unittest.TestCase):
|
||||
self.assertEqual(acc.char_position_state.value, 0)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_target_position.set_value(75)
|
||||
acc.char_target_position.client_update_value(75)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_SERVICE], 'set_cover_position')
|
||||
|
||||
@@ -57,7 +57,7 @@ class TestHomekitLights(unittest.TestCase):
|
||||
self.assertEqual(acc.char_on.value, 0)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_on.set_value(1)
|
||||
acc.char_on.client_update_value(1)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(self.events[0].data[ATTR_DOMAIN], DOMAIN)
|
||||
self.assertEqual(self.events[0].data[ATTR_SERVICE], SERVICE_TURN_ON)
|
||||
@@ -65,7 +65,7 @@ class TestHomekitLights(unittest.TestCase):
|
||||
self.hass.states.set(entity_id, STATE_ON)
|
||||
self.hass.block_till_done()
|
||||
|
||||
acc.char_on.set_value(0)
|
||||
acc.char_on.client_update_value(0)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(self.events[1].data[ATTR_DOMAIN], DOMAIN)
|
||||
self.assertEqual(self.events[1].data[ATTR_SERVICE], SERVICE_TURN_OFF)
|
||||
@@ -94,8 +94,8 @@ class TestHomekitLights(unittest.TestCase):
|
||||
self.assertEqual(acc.char_brightness.value, 40)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_brightness.set_value(20)
|
||||
acc.char_on.set_value(1)
|
||||
acc.char_brightness.client_update_value(20)
|
||||
acc.char_on.client_update_value(1)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(self.events[0].data[ATTR_DOMAIN], DOMAIN)
|
||||
self.assertEqual(self.events[0].data[ATTR_SERVICE], SERVICE_TURN_ON)
|
||||
@@ -103,8 +103,8 @@ class TestHomekitLights(unittest.TestCase):
|
||||
self.events[0].data[ATTR_SERVICE_DATA], {
|
||||
ATTR_ENTITY_ID: entity_id, ATTR_BRIGHTNESS_PCT: 20})
|
||||
|
||||
acc.char_on.set_value(1)
|
||||
acc.char_brightness.set_value(40)
|
||||
acc.char_on.client_update_value(1)
|
||||
acc.char_brightness.client_update_value(40)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(self.events[1].data[ATTR_DOMAIN], DOMAIN)
|
||||
self.assertEqual(self.events[1].data[ATTR_SERVICE], SERVICE_TURN_ON)
|
||||
@@ -112,8 +112,8 @@ class TestHomekitLights(unittest.TestCase):
|
||||
self.events[1].data[ATTR_SERVICE_DATA], {
|
||||
ATTR_ENTITY_ID: entity_id, ATTR_BRIGHTNESS_PCT: 40})
|
||||
|
||||
acc.char_on.set_value(1)
|
||||
acc.char_brightness.set_value(0)
|
||||
acc.char_on.client_update_value(1)
|
||||
acc.char_brightness.client_update_value(0)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(self.events[2].data[ATTR_DOMAIN], DOMAIN)
|
||||
self.assertEqual(self.events[2].data[ATTR_SERVICE], SERVICE_TURN_OFF)
|
||||
@@ -132,7 +132,7 @@ class TestHomekitLights(unittest.TestCase):
|
||||
self.assertEqual(acc.char_color_temperature.value, 190)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_color_temperature.set_value(250)
|
||||
acc.char_color_temperature.client_update_value(250)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(self.events[0].data[ATTR_DOMAIN], DOMAIN)
|
||||
self.assertEqual(self.events[0].data[ATTR_SERVICE], SERVICE_TURN_ON)
|
||||
@@ -156,8 +156,8 @@ class TestHomekitLights(unittest.TestCase):
|
||||
self.assertEqual(acc.char_saturation.value, 90)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_hue.set_value(145)
|
||||
acc.char_saturation.set_value(75)
|
||||
acc.char_hue.client_update_value(145)
|
||||
acc.char_saturation.client_update_value(75)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(self.events[0].data[ATTR_DOMAIN], DOMAIN)
|
||||
self.assertEqual(self.events[0].data[ATTR_SERVICE], SERVICE_TURN_ON)
|
||||
|
||||
@@ -71,7 +71,7 @@ class TestHomekitSecuritySystems(unittest.TestCase):
|
||||
self.assertEqual(acc.char_current_state.value, 3)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_target_state.set_value(0)
|
||||
acc.char_target_state.client_update_value(0)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_SERVICE], 'alarm_arm_home')
|
||||
@@ -79,7 +79,7 @@ class TestHomekitSecuritySystems(unittest.TestCase):
|
||||
self.events[0].data[ATTR_SERVICE_DATA][ATTR_CODE], '1234')
|
||||
self.assertEqual(acc.char_target_state.value, 0)
|
||||
|
||||
acc.char_target_state.set_value(1)
|
||||
acc.char_target_state.client_update_value(1)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[1].data[ATTR_SERVICE], 'alarm_arm_away')
|
||||
@@ -87,7 +87,7 @@ class TestHomekitSecuritySystems(unittest.TestCase):
|
||||
self.events[0].data[ATTR_SERVICE_DATA][ATTR_CODE], '1234')
|
||||
self.assertEqual(acc.char_target_state.value, 1)
|
||||
|
||||
acc.char_target_state.set_value(2)
|
||||
acc.char_target_state.client_update_value(2)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[2].data[ATTR_SERVICE], 'alarm_arm_night')
|
||||
@@ -95,7 +95,7 @@ class TestHomekitSecuritySystems(unittest.TestCase):
|
||||
self.events[0].data[ATTR_SERVICE_DATA][ATTR_CODE], '1234')
|
||||
self.assertEqual(acc.char_target_state.value, 2)
|
||||
|
||||
acc.char_target_state.set_value(3)
|
||||
acc.char_target_state.client_update_value(3)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[3].data[ATTR_SERVICE], 'alarm_disarm')
|
||||
@@ -112,7 +112,7 @@ class TestHomekitSecuritySystems(unittest.TestCase):
|
||||
acc.run()
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_target_state.set_value(0)
|
||||
acc.char_target_state.client_update_value(0)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_SERVICE], 'alarm_arm_home')
|
||||
|
||||
@@ -51,14 +51,14 @@ class TestHomekitSwitches(unittest.TestCase):
|
||||
self.assertEqual(acc.char_on.value, False)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_on.set_value(True)
|
||||
acc.char_on.client_update_value(True)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_DOMAIN], domain)
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_SERVICE], SERVICE_TURN_ON)
|
||||
|
||||
acc.char_on.set_value(False)
|
||||
acc.char_on.client_update_value(False)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[1].data[ATTR_DOMAIN], domain)
|
||||
@@ -76,7 +76,7 @@ class TestHomekitSwitches(unittest.TestCase):
|
||||
self.assertEqual(acc.char_on.value, False)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_on.set_value(True)
|
||||
acc.char_on.client_update_value(True)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_DOMAIN], domain)
|
||||
@@ -95,7 +95,7 @@ class TestHomekitSwitches(unittest.TestCase):
|
||||
self.assertEqual(acc.char_on.value, False)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_on.set_value(True)
|
||||
acc.char_on.client_update_value(True)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_DOMAIN], domain)
|
||||
|
||||
@@ -151,7 +151,7 @@ class TestHomekitThermostats(unittest.TestCase):
|
||||
self.assertEqual(acc.char_display_units.value, 0)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_target_temp.set_value(19.0)
|
||||
acc.char_target_temp.client_update_value(19.0)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_SERVICE], 'set_temperature')
|
||||
@@ -159,7 +159,7 @@ class TestHomekitThermostats(unittest.TestCase):
|
||||
self.events[0].data[ATTR_SERVICE_DATA][ATTR_TEMPERATURE], 19.0)
|
||||
self.assertEqual(acc.char_target_temp.value, 19.0)
|
||||
|
||||
acc.char_target_heat_cool.set_value(1)
|
||||
acc.char_target_heat_cool.client_update_value(1)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[1].data[ATTR_SERVICE], 'set_operation_mode')
|
||||
@@ -221,7 +221,7 @@ class TestHomekitThermostats(unittest.TestCase):
|
||||
self.assertEqual(acc.char_display_units.value, 0)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_heating_thresh_temp.set_value(20.0)
|
||||
acc.char_heating_thresh_temp.client_update_value(20.0)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[0].data[ATTR_SERVICE], 'set_temperature')
|
||||
@@ -229,7 +229,7 @@ class TestHomekitThermostats(unittest.TestCase):
|
||||
self.events[0].data[ATTR_SERVICE_DATA][ATTR_TARGET_TEMP_LOW], 20.0)
|
||||
self.assertEqual(acc.char_heating_thresh_temp.value, 20.0)
|
||||
|
||||
acc.char_cooling_thresh_temp.set_value(25.0)
|
||||
acc.char_cooling_thresh_temp.client_update_value(25.0)
|
||||
self.hass.block_till_done()
|
||||
self.assertEqual(
|
||||
self.events[1].data[ATTR_SERVICE], 'set_temperature')
|
||||
@@ -260,19 +260,19 @@ class TestHomekitThermostats(unittest.TestCase):
|
||||
self.assertEqual(acc.char_display_units.value, 1)
|
||||
|
||||
# Set from HomeKit
|
||||
acc.char_cooling_thresh_temp.set_value(23)
|
||||
acc.char_cooling_thresh_temp.client_update_value(23)
|
||||
self.hass.block_till_done()
|
||||
service_data = self.events[-1].data[ATTR_SERVICE_DATA]
|
||||
self.assertEqual(service_data[ATTR_TARGET_TEMP_HIGH], 73.4)
|
||||
self.assertEqual(service_data[ATTR_TARGET_TEMP_LOW], 68)
|
||||
|
||||
acc.char_heating_thresh_temp.set_value(22)
|
||||
acc.char_heating_thresh_temp.client_update_value(22)
|
||||
self.hass.block_till_done()
|
||||
service_data = self.events[-1].data[ATTR_SERVICE_DATA]
|
||||
self.assertEqual(service_data[ATTR_TARGET_TEMP_HIGH], 73.4)
|
||||
self.assertEqual(service_data[ATTR_TARGET_TEMP_LOW], 71.6)
|
||||
|
||||
acc.char_target_temp.set_value(24.0)
|
||||
acc.char_target_temp.client_update_value(24.0)
|
||||
self.hass.block_till_done()
|
||||
service_data = self.events[-1].data[ATTR_SERVICE_DATA]
|
||||
self.assertEqual(service_data[ATTR_TEMPERATURE], 75.2)
|
||||
Reference in new issue
Block a user