mirror of
https://github.com/home-assistant/core.git
synced 2026-11-29 01:02:03 -04:00
Add HmIP-STV to HomematicIP Cloud (#39518)
* add general attribute for connection type * Add HmIP-STV to HomematicIP Cloud
This commit is contained in:
@@ -75,6 +75,42 @@ async def test_hmip_acceleration_sensor(hass, default_mock_hap_factory):
|
||||
assert len(hmip_device.mock_calls) == service_call_counter + 2
|
||||
|
||||
|
||||
async def test_hmip_tilt_vibration_sensor(hass, default_mock_hap_factory):
|
||||
"""Test HomematicipTiltVibrationSensor."""
|
||||
entity_id = "binary_sensor.garage_neigungs_und_erschutterungssensor"
|
||||
entity_name = "Garage Neigungs- und Erschütterungssensor"
|
||||
device_model = "HmIP-STV"
|
||||
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
|
||||
test_devices=[entity_name]
|
||||
)
|
||||
|
||||
ha_state, hmip_device = get_and_check_entity_basics(
|
||||
hass, mock_hap, entity_id, entity_name, device_model
|
||||
)
|
||||
|
||||
assert ha_state.state == STATE_ON
|
||||
assert ha_state.attributes[ATTR_ACCELERATION_SENSOR_MODE] == "FLAT_DECT"
|
||||
assert (
|
||||
ha_state.attributes[ATTR_ACCELERATION_SENSOR_SENSITIVITY] == "SENSOR_RANGE_2G"
|
||||
)
|
||||
assert ha_state.attributes[ATTR_ACCELERATION_SENSOR_TRIGGER_ANGLE] == 45
|
||||
service_call_counter = len(hmip_device.mock_calls)
|
||||
|
||||
await async_manipulate_test_data(
|
||||
hass, hmip_device, "accelerationSensorTriggered", False
|
||||
)
|
||||
ha_state = hass.states.get(entity_id)
|
||||
assert ha_state.state == STATE_OFF
|
||||
assert len(hmip_device.mock_calls) == service_call_counter + 1
|
||||
|
||||
await async_manipulate_test_data(
|
||||
hass, hmip_device, "accelerationSensorTriggered", True
|
||||
)
|
||||
ha_state = hass.states.get(entity_id)
|
||||
assert ha_state.state == STATE_ON
|
||||
assert len(hmip_device.mock_calls) == service_call_counter + 2
|
||||
|
||||
|
||||
async def test_hmip_contact_interface(hass, default_mock_hap_factory):
|
||||
"""Test HomematicipContactInterface."""
|
||||
entity_id = "binary_sensor.kontakt_schnittstelle_unterputz_1_fach"
|
||||
|
||||
@@ -22,7 +22,7 @@ async def test_hmip_load_all_supported_devices(hass, default_mock_hap_factory):
|
||||
test_devices=None, test_groups=None
|
||||
)
|
||||
|
||||
assert len(mock_hap.hmip_device_by_entity_id) == 190
|
||||
assert len(mock_hap.hmip_device_by_entity_id) == 191
|
||||
|
||||
|
||||
async def test_hmip_remove_device(hass, default_mock_hap_factory):
|
||||
|
||||
Reference in New Issue
Block a user