Exemplo n.º 1
0
async def test_security_setZoneActivationDelay(no_ssl_fake_async_home: AsyncHome):
    securityAlarmHome = no_ssl_fake_async_home.get_functionalHome(SecurityAndAlarmHome)
    assert securityAlarmHome.zoneActivationDelay == 0.0

    await no_ssl_fake_async_home.set_zone_activation_delay(5.0)
    await no_ssl_fake_async_home.get_current_state()
    securityAlarmHome = no_ssl_fake_async_home.get_functionalHome(SecurityAndAlarmHome)
    assert securityAlarmHome.zoneActivationDelay == 5.0

    await no_ssl_fake_async_home.set_zone_activation_delay(0.0)
    await no_ssl_fake_async_home.get_current_state()
    securityAlarmHome = no_ssl_fake_async_home.get_functionalHome(SecurityAndAlarmHome)
    assert securityAlarmHome.zoneActivationDelay == 0.0
Exemplo n.º 2
0
async def test_security_setIntrusionAlertThroughSmokeDetectors(
    no_ssl_fake_async_home: AsyncHome,
):
    securityAlarmHome = no_ssl_fake_async_home.get_functionalHome(SecurityAndAlarmHome)
    assert securityAlarmHome.intrusionAlertThroughSmokeDetectors is False

    await no_ssl_fake_async_home.set_intrusion_alert_through_smoke_detectors(True)
    await no_ssl_fake_async_home.get_current_state()
    securityAlarmHome = no_ssl_fake_async_home.get_functionalHome(SecurityAndAlarmHome)
    assert securityAlarmHome.intrusionAlertThroughSmokeDetectors is True

    await no_ssl_fake_async_home.set_intrusion_alert_through_smoke_detectors(False)
    await no_ssl_fake_async_home.get_current_state()
    securityAlarmHome = no_ssl_fake_async_home.get_functionalHome(SecurityAndAlarmHome)
    assert securityAlarmHome.intrusionAlertThroughSmokeDetectors is False
async def test_heating_vacation(no_ssl_fake_async_home: AsyncHome):
    tomorrow = datetime.now() + timedelta(days=1)
    tomorrow = tomorrow.replace(second=0, microsecond=0)

    await no_ssl_fake_async_home.activate_vacation(tomorrow, 12)

    await no_ssl_fake_async_home.get_current_state()
    heatingHome = no_ssl_fake_async_home.get_functionalHome(IndoorClimateHome)
    assert heatingHome.absenceEndTime == tomorrow
    assert heatingHome.absenceType == AbsenceType.VACATION

    await no_ssl_fake_async_home.deactivate_vacation()

    await no_ssl_fake_async_home.get_current_state()
    heatingHome = no_ssl_fake_async_home.get_functionalHome(IndoorClimateHome)
    assert heatingHome.absenceEndTime == None
    assert heatingHome.absenceType == AbsenceType.NOT_ABSENT