core/tests/components/switcher_kis/consts.py

142 lines
3.6 KiB
Python
Raw Normal View History

Added component named switcher_kis switcher water heater integration. (#22325) * Added component named switcher_kis switcher water heater integration. * Fixed conflicts. * Updated requirements. * Added manifest.json file and updated CODEOWNERS. * Fixed requirements_all.txt. * Better component tests. * Removed unnecessary parameter from fixture function. * Removed tests section from mypy.ini. * Remove unused ENTITY_ID_FORMAT. * Stop udp bridge when failed to setup the component. * Replace DISCOVERY_ constants prefix with DATA_. * Various change requests. * Fixed constant name change remifications. * Added explicit name to fixture. * Various change requests. * More various change requests. * Added EventType for homeassistant.core.Event. * Switched from event driven data distribution to dispatcher type plus clean-ups. * Removed name and icon keys from the component configuration. * Various change requests. * Various change reqeusts and clean-ups. * Removed unnecessary DEPENDENCIES constant from swith platform. * Replaced configuration data guard with assert. * Removed unused constants. * Removed confusing type casting for mypy sake. * Refactor property device_name to name. * Removed None guard effecting mypy only. * Removed unnecessary function from switch entity. * Removed None guard in use by mypy only. * Removed unused constant. * Removed unnecessary context manager. * Stopped messing around with mypy.ini. * Referring to typing.TYPE_CHECKING for non-runtime imports. * Added test requierment correctyly. * Replaced queue.get() with queue.get_nowait() to avoid backing up intervals requests. * Revert changes in mypy.ini. * Changed attributes content to device properties instead of entity properties. * Fixed typo in constant name. * Remove unnecessary async keyword from callable. * Waiting for tasks on event loop to end. * Added callback decorator to callable.
2019-04-19 21:54:48 +00:00
"""Constants for the Switcher integration tests."""
from aioswitcher.device import (
DeviceState,
DeviceType,
ShutterDirection,
SwitcherPowerPlug,
SwitcherShutter,
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
SwitcherSingleShutterDualLight,
SwitcherThermostat,
SwitcherWaterHeater,
ThermostatFanLevel,
ThermostatMode,
ThermostatSwing,
)
2019-07-31 19:25:30 +00:00
DUMMY_AUTO_OFF_SET = "01:30:00"
DUMMY_AUTO_SHUT_DOWN = "02:00:00"
DUMMY_DEVICE_ID1 = "a123bc"
DUMMY_DEVICE_ID2 = "cafe12"
DUMMY_DEVICE_ID3 = "bada77"
DUMMY_DEVICE_ID4 = "bbd164"
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_DEVICE_ID5 = "bcdb64"
DUMMY_DEVICE_KEY1 = "18"
DUMMY_DEVICE_KEY2 = "01"
DUMMY_DEVICE_KEY3 = "12"
DUMMY_DEVICE_KEY4 = "07"
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_DEVICE_KEY5 = "15"
DUMMY_DEVICE_NAME1 = "Plug 23BC"
DUMMY_DEVICE_NAME2 = "Heater FE12"
DUMMY_DEVICE_NAME3 = "Breeze AB39"
DUMMY_DEVICE_NAME4 = "Runner DD77"
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_DEVICE_NAME5 = "RunnerS11 6CF5"
2019-07-31 19:25:30 +00:00
DUMMY_DEVICE_PASSWORD = "12345678"
DUMMY_ELECTRIC_CURRENT1 = 0.5
DUMMY_ELECTRIC_CURRENT2 = 12.8
DUMMY_IP_ADDRESS1 = "192.168.100.157"
DUMMY_IP_ADDRESS2 = "192.168.100.158"
DUMMY_IP_ADDRESS3 = "192.168.100.159"
DUMMY_IP_ADDRESS4 = "192.168.100.160"
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_IP_ADDRESS5 = "192.168.100.161"
DUMMY_MAC_ADDRESS1 = "A1:B2:C3:45:67:D8"
DUMMY_MAC_ADDRESS2 = "A1:B2:C3:45:67:D9"
DUMMY_MAC_ADDRESS3 = "A1:B2:C3:45:67:DA"
DUMMY_MAC_ADDRESS4 = "A1:B2:C3:45:67:DB"
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_MAC_ADDRESS5 = "A1:B2:C3:45:67:DC"
DUMMY_TOKEN_NEEDED1 = False
DUMMY_TOKEN_NEEDED2 = False
DUMMY_TOKEN_NEEDED3 = False
DUMMY_TOKEN_NEEDED4 = False
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_TOKEN_NEEDED5 = True
2019-07-31 19:25:30 +00:00
DUMMY_PHONE_ID = "1234"
DUMMY_POWER_CONSUMPTION1 = 100
DUMMY_POWER_CONSUMPTION2 = 2780
2019-07-31 19:25:30 +00:00
DUMMY_REMAINING_TIME = "01:29:32"
DUMMY_TIMER_MINUTES_SET = "90"
DUMMY_THERMOSTAT_MODE = ThermostatMode.COOL
DUMMY_TEMPERATURE = 24.1
DUMMY_TARGET_TEMPERATURE = 23
DUMMY_FAN_LEVEL = ThermostatFanLevel.LOW
DUMMY_SWING = ThermostatSwing.OFF
DUMMY_REMOTE_ID = "ELEC7001"
DUMMY_POSITION = [54]
DUMMY_DIRECTION = [ShutterDirection.SHUTTER_STOP]
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_USERNAME = "email"
DUMMY_TOKEN = "zvVvd7JxtN7CgvkD1Psujw=="
DUMMY_LIGHT_2 = [DeviceState.ON, DeviceState.ON]
Added component named switcher_kis switcher water heater integration. (#22325) * Added component named switcher_kis switcher water heater integration. * Fixed conflicts. * Updated requirements. * Added manifest.json file and updated CODEOWNERS. * Fixed requirements_all.txt. * Better component tests. * Removed unnecessary parameter from fixture function. * Removed tests section from mypy.ini. * Remove unused ENTITY_ID_FORMAT. * Stop udp bridge when failed to setup the component. * Replace DISCOVERY_ constants prefix with DATA_. * Various change requests. * Fixed constant name change remifications. * Added explicit name to fixture. * Various change requests. * More various change requests. * Added EventType for homeassistant.core.Event. * Switched from event driven data distribution to dispatcher type plus clean-ups. * Removed name and icon keys from the component configuration. * Various change requests. * Various change reqeusts and clean-ups. * Removed unnecessary DEPENDENCIES constant from swith platform. * Replaced configuration data guard with assert. * Removed unused constants. * Removed confusing type casting for mypy sake. * Refactor property device_name to name. * Removed None guard effecting mypy only. * Removed unnecessary function from switch entity. * Removed None guard in use by mypy only. * Removed unused constant. * Removed unnecessary context manager. * Stopped messing around with mypy.ini. * Referring to typing.TYPE_CHECKING for non-runtime imports. * Added test requierment correctyly. * Replaced queue.get() with queue.get_nowait() to avoid backing up intervals requests. * Revert changes in mypy.ini. * Changed attributes content to device properties instead of entity properties. * Fixed typo in constant name. * Remove unnecessary async keyword from callable. * Waiting for tasks on event loop to end. * Added callback decorator to callable.
2019-04-19 21:54:48 +00:00
DUMMY_PLUG_DEVICE = SwitcherPowerPlug(
DeviceType.POWER_PLUG,
DeviceState.ON,
DUMMY_DEVICE_ID1,
DUMMY_DEVICE_KEY1,
DUMMY_IP_ADDRESS1,
DUMMY_MAC_ADDRESS1,
DUMMY_DEVICE_NAME1,
DUMMY_TOKEN_NEEDED1,
DUMMY_POWER_CONSUMPTION1,
DUMMY_ELECTRIC_CURRENT1,
)
DUMMY_WATER_HEATER_DEVICE = SwitcherWaterHeater(
DeviceType.V4,
DeviceState.ON,
DUMMY_DEVICE_ID2,
DUMMY_DEVICE_KEY2,
DUMMY_IP_ADDRESS2,
DUMMY_MAC_ADDRESS2,
DUMMY_DEVICE_NAME2,
DUMMY_TOKEN_NEEDED2,
DUMMY_POWER_CONSUMPTION2,
DUMMY_ELECTRIC_CURRENT2,
DUMMY_REMAINING_TIME,
DUMMY_AUTO_SHUT_DOWN,
)
DUMMY_SHUTTER_DEVICE = SwitcherShutter(
DeviceType.RUNNER,
DeviceState.ON,
DUMMY_DEVICE_ID4,
DUMMY_DEVICE_KEY4,
DUMMY_IP_ADDRESS4,
DUMMY_MAC_ADDRESS4,
DUMMY_DEVICE_NAME4,
DUMMY_TOKEN_NEEDED4,
DUMMY_POSITION,
DUMMY_DIRECTION,
)
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
DUMMY_SINGLE_SHUTTER_DUAL_LIGHT_DEVICE = SwitcherSingleShutterDualLight(
DeviceType.RUNNER_S11,
DeviceState.ON,
DUMMY_DEVICE_ID5,
DUMMY_DEVICE_KEY5,
DUMMY_IP_ADDRESS5,
DUMMY_MAC_ADDRESS5,
DUMMY_DEVICE_NAME5,
DUMMY_TOKEN_NEEDED5,
DUMMY_POSITION,
DUMMY_DIRECTION,
DUMMY_LIGHT_2,
Add Switcher Runner S11 support (#123578) * switcher start s11 integration * switcher linting * switcher starting reauth logic * switcher fix linting * switcher fix linting * switcher remove get_circuit_number * switcher adding support for validate token * switcher fix initial auth for new devices and fix strings * switcher fix linting * switcher fix utils * Revert "switcher fix utils" This reverts commit b162a943b94fb0a581140feb21fe871df578c16a. * switcher revert and test * switcher fix validate logic and strings * switcher add tests to improve coverage * switcher adding tests * switcher adding test * switcher revert back things * switcher fix based on requested changes * switcher tests fixes * switcher fix based on requested changes * switcher remove single_instance_allowed code and added tests * Update config_flow.py * switcher fix comment * switcher fix tests * switcher lint * switcehr fix based on requested changes * switche fix lint * switcher small rename fix * switcher fix based on requested changes * switcher fix based on requested changes * switcher fix based on requested changes * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py Co-authored-by: Shay Levy <levyshay1@gmail.com> * Update tests/components/switcher_kis/test_config_flow.py --------- Co-authored-by: Shay Levy <levyshay1@gmail.com>
2024-09-20 20:19:57 +00:00
)
DUMMY_THERMOSTAT_DEVICE = SwitcherThermostat(
DeviceType.BREEZE,
DeviceState.ON,
DUMMY_DEVICE_ID3,
DUMMY_DEVICE_KEY3,
DUMMY_IP_ADDRESS3,
DUMMY_MAC_ADDRESS3,
DUMMY_DEVICE_NAME3,
DUMMY_TOKEN_NEEDED3,
DUMMY_THERMOSTAT_MODE,
DUMMY_TEMPERATURE,
DUMMY_TARGET_TEMPERATURE,
DUMMY_FAN_LEVEL,
DUMMY_SWING,
DUMMY_REMOTE_ID,
)
DUMMY_SWITCHER_DEVICES = [DUMMY_PLUG_DEVICE, DUMMY_WATER_HEATER_DEVICE]