Add binary_sensor for cloud connectivity to HomematicIP Cloud (#39675)

* Add binary_sensor for cloud connectivity to HomematicIP Cloud

* Fix Test

* Remove device_class

* Switch from _device to _home

* Switch from _device to _home for sensor
This commit is contained in:
SukramJ authored and GitHub committed 2020-09-19 10:59:46 -05:00
1 parent b088830382
commit e300cf3747
5 files changed
+67 -6

No files matched your search

@@ -38,6 +38,29 @@ async def test_manually_configured_platform(hass):
assert not hass.data.get(HMIPC_DOMAIN)
async def test_hmip_access_point_cloud_connection_sensor(
hass, default_mock_hap_factory
):
"""Test HomematicipCloudConnectionSensor."""
entity_id = "binary_sensor.access_point_cloud_connection"
entity_name = "Access Point Cloud Connection"
device_model = None
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
await async_manipulate_test_data(hass, hmip_device, "connected", False)
ha_state = hass.states.get(entity_id)
assert ha_state.state == STATE_OFF
async def test_hmip_acceleration_sensor(hass, default_mock_hap_factory):
"""Test HomematicipAccelerationSensor."""
entity_id = "binary_sensor.garagentor"
@@ -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) == 191
assert len(mock_hap.hmip_device_by_entity_id) == 192
async def test_hmip_remove_device(hass, default_mock_hap_factory):
@@ -44,8 +44,8 @@ async def test_manually_configured_platform(hass):
async def test_hmip_accesspoint_status(hass, default_mock_hap_factory):
"""Test HomematicipSwitch."""
entity_id = "sensor.access_point"
entity_name = "Access Point"
entity_id = "sensor.access_point_duty_cycle"
entity_name = "Access Point Duty Cycle"
device_model = None
mock_hap = await default_mock_hap_factory.async_get_mock_hap(
test_devices=[entity_name]