core/homeassistant/components/wallbox/const.py

55 lines
1.9 KiB
Python
Raw Normal View History

Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
"""Constants for the Wallbox integration."""
from homeassistant.backports.enum import StrEnum
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
DOMAIN = "wallbox"
BIDIRECTIONAL_MODEL_PREFIXES = ["QSX"]
Add wallbox integration (#48082) * Wallbox component added * resolved mergeconflicts from upstream * fixed an incorrect removal in CODEOWNERS file * fixes for pullrequest automatic test * clean up code after PR tests * fixed strings.json * fix config_flow error > wallbox * fixed some formatting issues * fix pylint warnings * fixed error in number.py > set value * pylint warnings fixed * some more pylint fixes * isort fixes * fix unused_import pylint * remove tests * remove test requirements * config flow test * test errors resolved * test file formatting * isort on test file * sensor test * isort on test * isort test const * remove not working sensor test * remove test const * add switch, number and lock test * docstrings for test classes * sort test_number, create test_sensor * additional tests * fix test error * reduced PR to 1 component * newline in const * ignore test coverage -> dependency on external device (wallbox) * do not ignore config_flow * add test for validate_input * remove obsolete import * additional test config flow * change test sensor * docstring * add additional test for exceptions * fix test_config * more tests * fix test_config_flow * fixed http error test * catch connectionerror and introduce testing for this error * remove .coveragefile * change comment * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen Co-authored-by: jan iversen <jancasacondor@gmail.com> * Update homeassistant/components/wallbox/__init__.py review suggestion by janiversen (format only) Co-authored-by: jan iversen <jancasacondor@gmail.com> * Processed review comments, include more testing for sensor component * Isolated the async_add_executor_job to make the solution more async * add a config flow test * Revert "add a config flow test" This reverts commit 9c1af82fffeb0b46f11ada1000e19b66fd5fd0f1. * Revert "Isolated the async_add_executor_job to make the solution more async" This reverts commit 0bf034c3318f27e649389830d4ad7a7e10eb2d6f. * Make component more async and add config flow tests * Changes based on review comments * made _ methods in WallboxHub for the 'non-async' call to the API and try-catch. Stored the wallbox in the class. * moved the coordinator to __init__ and pass it as part of the WallboxHub class * removed obsolete function in __init__ * removed CONNECTION_CLASS = config_entries.CONN_CLASS_CLOUD_POLL * fixed spelling and imports on test files * did isort on component files Co-authored-by: jan iversen <jancasacondor@gmail.com>
2021-05-24 11:08:24 +00:00
CONF_STATION = "station"
CHARGER_ADDED_DISCHARGED_ENERGY_KEY = "added_discharged_energy"
CHARGER_ADDED_ENERGY_KEY = "added_energy"
CHARGER_ADDED_RANGE_KEY = "added_range"
CHARGER_CHARGING_POWER_KEY = "charging_power"
CHARGER_CHARGING_SPEED_KEY = "charging_speed"
CHARGER_CHARGING_TIME_KEY = "charging_time"
CHARGER_COST_KEY = "cost"
CHARGER_CURRENT_MODE_KEY = "current_mode"
CHARGER_CURRENT_VERSION_KEY = "currentVersion"
CHARGER_DATA_KEY = "config_data"
CHARGER_DEPOT_PRICE_KEY = "depot_price"
CHARGER_SERIAL_NUMBER_KEY = "serial_number"
CHARGER_PART_NUMBER_KEY = "part_number"
CHARGER_SOFTWARE_KEY = "software"
CHARGER_MAX_AVAILABLE_POWER_KEY = "max_available_power"
CHARGER_MAX_CHARGING_CURRENT_KEY = "max_charging_current"
CHARGER_PAUSE_RESUME_KEY = "paused"
CHARGER_LOCKED_UNLOCKED_KEY = "locked"
CHARGER_NAME_KEY = "name"
CHARGER_STATE_OF_CHARGE_KEY = "state_of_charge"
CHARGER_STATUS_ID_KEY = "status_id"
CHARGER_STATUS_DESCRIPTION_KEY = "status_description"
CHARGER_CONNECTIONS = "connections"
class ChargerStatus(StrEnum):
"""Charger Status Description."""
CHARGING = "Charging"
DISCHARGING = "Discharging"
PAUSED = "Paused"
SCHEDULED = "Scheduled"
WAITING_FOR_CAR = "Waiting for car demand"
WAITING = "Waiting"
DISCONNECTED = "Disconnected"
ERROR = "Error"
READY = "Ready"
LOCKED = "Locked"
LOCKED_CAR_CONNECTED = "Locked, car connected"
UPDATING = "Updating"
WAITING_IN_QUEUE_POWER_SHARING = "Waiting in queue by Power Sharing"
WAITING_IN_QUEUE_POWER_BOOST = "Waiting in queue by Power Boost"
WAITING_MID_FAILED = "Waiting MID failed"
WAITING_MID_SAFETY = "Waiting MID safety margin exceeded"
WAITING_IN_QUEUE_ECO_SMART = "Waiting in queue by Eco-Smart"
UNKNOWN = "Unknown"