aioafero package¶
Subpackages¶
- aioafero.v1 package
- Subpackages
- aioafero.v1.controllers package
- Submodules
- aioafero.v1.controllers.base module
- aioafero.v1.controllers.climate module
- aioafero.v1.controllers.device module
- aioafero.v1.controllers.event module
- aioafero.v1.controllers.exhaust_fan module
- aioafero.v1.controllers.fan module
- aioafero.v1.controllers.light module
- aioafero.v1.controllers.lock module
- aioafero.v1.controllers.portable_ac module
- aioafero.v1.controllers.security_system module
- aioafero.v1.controllers.security_system_keypad module
- aioafero.v1.controllers.security_system_sensor module
- aioafero.v1.controllers.switch module
- aioafero.v1.controllers.thermostat module
- aioafero.v1.controllers.valve module
- Module contents
- aioafero.v1.models package
- Submodules
- aioafero.v1.models.device module
- aioafero.v1.models.exhaust_fan module
- aioafero.v1.models.fan module
- aioafero.v1.models.features module
- aioafero.v1.models.hvac_mixin module
- aioafero.v1.models.light module
- aioafero.v1.models.lock module
- aioafero.v1.models.portable_ac module
- aioafero.v1.models.resource module
- aioafero.v1.models.security_system module
- aioafero.v1.models.security_system_keypad module
- aioafero.v1.models.security_system_sensor module
- aioafero.v1.models.sensor module
- aioafero.v1.models.standard_mixin module
- aioafero.v1.models.switch module
- aioafero.v1.models.thermostat module
- aioafero.v1.models.valve module
- Module contents
- aioafero.v1.controllers package
- Submodules
- aioafero.v1.auth module
AferoAuthAferoAuth.__init__()AferoAuth.is_expiredAferoAuth.refresh_tokenAferoAuth.generate_auth_url()AferoAuth.set_token_data()AferoAuth.webapp_login()AferoAuth.generate_challenge_data()AferoAuth.generate_code()AferoAuth.requires_otp()AferoAuth.parse_code()AferoAuth.generate_refresh_token()AferoAuth.perform_initial_login()AferoAuth.perform_otp_login()AferoAuth.submit_otp()AferoAuth.token()
TokenDatapassthrough()
- aioafero.v1.v1_const module
- Module contents
AferoBridgeV1AferoBridgeV1.__init__()AferoBridgeV1.refresh_tokenAferoBridgeV1.eventsAferoBridgeV1.controllersAferoBridgeV1.tracked_devicesAferoBridgeV1.otp_login()AferoBridgeV1.add_device()AferoBridgeV1.get_device_controller()AferoBridgeV1.remove_device()AferoBridgeV1.add_afero_dev()AferoBridgeV1.get_afero_device()AferoBridgeV1.resolve_metadevice_id()AferoBridgeV1.account_idAferoBridgeV1.afero_clientAferoBridgeV1.add_controller()AferoBridgeV1.set_token_data()AferoBridgeV1.set_polling_interval()AferoBridgeV1.generate_api_url()AferoBridgeV1.close()AferoBridgeV1.subscribe()AferoBridgeV1.get_account_id()AferoBridgeV1.initialize()AferoBridgeV1.fetch_discovery_data()AferoBridgeV1.fetch_device_states()AferoBridgeV1.fetch_all_device_states()AferoBridgeV1.get_device_version()AferoBridgeV1.create_request()AferoBridgeV1.request()AferoBridgeV1.send_service_request()AferoBridgeV1.get_headers()AferoBridgeV1.add_job()AferoBridgeV1.async_block_until_done()AferoBridgeV1.initialize_cleanup()AferoBridgeV1.adjust_temperature_unit()
AferoControllerAferoModelResourceBaseResourcesControllerBaseResourcesController.ITEM_TYPE_IDBaseResourcesController.ITEM_TYPESBaseResourcesController.ITEM_CLSBaseResourcesController.ITEM_MAPPINGBaseResourcesController.ITEM_SENSORSBaseResourcesController.ITEM_BINARY_SENSORSBaseResourcesController.ITEM_NUMBERSBaseResourcesController.ITEM_SELECTSBaseResourcesController.DEVICE_SPLIT_CALLBACKSBaseResourcesController.__init__()BaseResourcesController.__getitem__()BaseResourcesController.__iter__()BaseResourcesController.__contains__()BaseResourcesController.itemsBaseResourcesController.initializedBaseResourcesController.subscribersBaseResourcesController.emit_to_subscribers()BaseResourcesController.get_filtered_devices()BaseResourcesController.initialize()BaseResourcesController.initialize_number()BaseResourcesController.initialize_select()BaseResourcesController.initialize_sensor()BaseResourcesController.update_number()BaseResourcesController.update_select()BaseResourcesController.update_sensor()BaseResourcesController.split_sensor_data()BaseResourcesController.initialize_elem()BaseResourcesController.update_elem()BaseResourcesController.subscribe()BaseResourcesController.update_afero_api()BaseResourcesController.update()BaseResourcesController.generate_update_dev()BaseResourcesController.get_device()
DeviceControllerDeviceController.ITEM_TYPE_IDDeviceController.ITEM_TYPESDeviceController.ITEM_CLSDeviceController.ITEM_SENSORSDeviceController.ITEM_BINARY_SENSORSDeviceController.__init__()DeviceController.initialize_elem()DeviceController.initialize()DeviceController.get_filtered_devices()DeviceController.update_elem()
FanControllerFanController.ITEM_TYPE_IDFanController.ITEM_TYPESFanController.ITEM_CLSFanController.ITEM_MAPPINGFanController.turn_on()FanController.turn_off()FanController.set_speed()FanController.set_direction()FanController.set_preset()FanController.initialize_elem()FanController.update_elem()FanController.set_state()
LightControllerLightController.ITEM_TYPE_IDLightController.ITEM_TYPESLightController.ITEM_CLSLightController.ITEM_MAPPINGLightController.ITEM_NUMBERSLightController.DEVICE_SPLIT_CALLBACKSLightController.turn_on()LightController.turn_off()LightController.set_color_temperature()LightController.set_white()LightController.set_brightness()LightController.set_rgb()LightController.set_effect()LightController.initialize_elem()LightController.update_elem()LightController.update_elem_color()LightController.set_state()
LockControllerPortableACControllerPortableACController.ITEM_TYPE_IDPortableACController.ITEM_TYPESPortableACController.ITEM_CLSPortableACController.ITEM_MAPPINGPortableACController.ITEM_SELECTSPortableACController.DEVICE_SPLIT_CALLBACKSPortableACController.initialize_elem()PortableACController.update_elem()PortableACController.set_state()
SecuritySystemControllerSecuritySystemController.ITEM_TYPE_IDSecuritySystemController.ITEM_TYPESSecuritySystemController.ITEM_CLSSecuritySystemController.ITEM_MAPPINGSecuritySystemController.ITEM_SENSORSSecuritySystemController.ITEM_BINARY_SENSORSSecuritySystemController.ITEM_NUMBERSSecuritySystemController.ITEM_SELECTSSecuritySystemController.DEVICE_SPLIT_CALLBACKSSecuritySystemController.disarm()SecuritySystemController.arm_home()SecuritySystemController.arm_away()SecuritySystemController.alarm_trigger()SecuritySystemController.initialize_elem()SecuritySystemController.update_elem()SecuritySystemController.set_state()SecuritySystemController.refresh_alarm_state()SecuritySystemController.validate_disarm_pin()SecuritySystemController.validate_arm_state()
SecuritySystemKeypadControllerSecuritySystemKeypadController.ITEM_TYPE_IDSecuritySystemKeypadController.ITEM_TYPESSecuritySystemKeypadController.ITEM_CLSSecuritySystemKeypadController.ITEM_BINARY_SENSORSSecuritySystemKeypadController.ITEM_SELECTSSecuritySystemKeypadController.initialize_elem()SecuritySystemKeypadController.update_elem()SecuritySystemKeypadController.set_state()
SecuritySystemSensorControllerSecuritySystemSensorController.ITEM_TYPE_IDSecuritySystemSensorController.ITEM_TYPESSecuritySystemSensorController.ITEM_CLSSecuritySystemSensorController.ITEM_MAPPINGSecuritySystemSensorController.SENSOR_TYPESSecuritySystemSensorController.ITEM_BINARY_SENSORSSecuritySystemSensorController.ITEM_SELECTSSecuritySystemSensorController.initialize_elem()SecuritySystemSensorController.update_elem()SecuritySystemSensorController.set_state()
SwitchControllerSwitchController.ITEM_TYPE_IDSwitchController.ITEM_TYPESSwitchController.ITEM_CLSSwitchController.ITEM_MAPPINGSwitchController.ITEM_SENSORSSwitchController.ITEM_BINARY_SENSORSSwitchController.turn_on()SwitchController.turn_off()SwitchController.initialize_elem()SwitchController.update_elem()SwitchController.set_state()
ThermostatControllerThermostatController.ITEM_TYPE_IDThermostatController.ITEM_TYPESThermostatController.ITEM_CLSThermostatController.ITEM_MAPPINGThermostatController.ITEM_BINARY_SENSORSThermostatController.initialize_elem()ThermostatController.update_elem()ThermostatController.set_fan_mode()ThermostatController.set_hvac_mode()ThermostatController.set_target_temperature()ThermostatController.set_temperature_range()ThermostatController.set_state()
TokenDataValveController
- Subpackages
Submodules¶
aioafero.anonomyize_data module¶
Provides an interface for anonymizing data.
- aioafero.anonomyize_data.anonymize_device(dev: AferoDevice, parent_mapping: dict, device_links: dict, anon_name: bool) dict[source]¶
Convert an AferoDevice into an anonymized dictionary.
- Parameters:
dev (AferoDevice)
parent_mapping (dict)
device_links (dict)
anon_name (bool)
- Return type:
- aioafero.anonomyize_data.anonymize_devices(devices: list[AferoDevice], anon_name: bool = False) list[dict][source]¶
Remove identifying information from the device.
- Parameters:
devices (list[AferoDevice]) – List of devices to anonymize
anon_name (bool) – If true, give each device a unique name
- Return type:
aioafero.device module¶
Devices and States for API responses.
- class aioafero.device.AferoDevice(id: str, device_id: str, model: str, device_class: str, default_name: str, default_image: str, friendly_name: str, capabilities: list[AferoCapability] = <factory>, functions: list[dict] = <factory>, states: list[AferoState] = <factory>, children: list[str] = <factory>, manufacturerName: str | None = None, split_identifier: str | None = None, version_data: dict[str, str] | None=None)[source]¶
Bases:
objectMapped Device from an API response.
- Parameters:
- capabilities: list[AferoCapability]¶
- states: list[AferoState]¶
- __init__(id: str, device_id: str, model: str, device_class: str, default_name: str, default_image: str, friendly_name: str, capabilities: list[AferoCapability] = <factory>, functions: list[dict] = <factory>, states: list[AferoState] = <factory>, children: list[str] = <factory>, manufacturerName: str | None = None, split_identifier: str | None = None, version_data: dict[str, str] | None=None) None¶
- class aioafero.device.AferoState(functionClass: str, value: Any, lastUpdateTime: int | None = None, functionInstance: str | None = None)[source]¶
Bases:
objectState of a given function.
- Parameters:
- aioafero.device.get_afero_device(afero_device: dict[str, Any]) AferoDevice[source]¶
Convert the Afero device definition into a AferoDevice.
- Parameters:
- Return type:
aioafero.errors module¶
Errors used through aioafero.
- exception aioafero.errors.AferoError[source]¶
Bases:
ExceptionGeneric exception for Afero API or the responses.
- exception aioafero.errors.DeviceNotFound[source]¶
Bases:
AferoErrorDevice not found within the controller.
- exception aioafero.errors.DeviceUpdateError[source]¶
Bases:
AferoErrorUnable to send a device update to Afero API.
- exception aioafero.errors.ExceededMaximumRetries[source]¶
Bases:
AferoErrorMaximum retries exceeded when contacting Afero API.
- exception aioafero.errors.InvalidAuth[source]¶
Bases:
AferoErrorInvalid credentials supplied during authentication.
- exception aioafero.errors.InvalidResponse[source]¶
Bases:
AferoErrorAn invalid response was received from Afero API.
- exception aioafero.errors.SecuritySystemError[source]¶
Bases:
AferoErrorGeneric exception for Afero Security System issues.
- exception aioafero.errors.OTPError[source]¶
Bases:
AferoErrorIssue occurred with OTP authentication.
- exception aioafero.errors.OTPRequired[source]¶
Bases:
AferoErrorOne-time password is required for login.
aioafero.types module¶
Types used by the bridge and supporting elements.
- class aioafero.types.EventType(*values)[source]¶
Bases:
EnumEnum with possible Events.
- RESOURCE_ADDED = 'add'¶
- RESOURCE_UPDATED = 'update'¶
- RESOURCE_DELETED = 'delete'¶
- RESOURCE_VERSION = 'version'¶
- RESOURCE_UPDATE_RESPONSE = 'update_response'¶
- CONNECTED = 'connected'¶
- DISCONNECTED = 'disconnected'¶
- RECONNECTED = 'reconnected'¶
- INVALID_AUTH = 'invalid_auth'¶
- POLLED_DATA = 'polled_data'¶
- POLLED_DEVICES = 'polled_devices'¶
aioafero.util module¶
Generic utils for interacting with Afero IoT API or the responses.
- aioafero.util.get_afero_base_time_ms() int[source]¶
Return the current time as epoch milliseconds for v1 API state timestamps.
- Return type:
- aioafero.util.normalize_afero_last_update_time_ms(last_update_time: int | None) int[source]¶
Normalize v1 lastUpdateTime values to epoch milliseconds.
- aioafero.util.percentage_to_ordered_list_item(ordered_list: list[T], percentage: int) T[source]¶
Find the item that most closely matches the percentage in an ordered list.
When using this utility for fan speeds, do not include “off”
Given the list: [“low”, “medium”, “high”, “very_high”], this function will return the following when the item is passed in:
1-25: low 26-50: medium 51-75: high 76-100: very_high
- aioafero.util.ordered_list_item_to_percentage(ordered_list: list[T], item: T) int[source]¶
Determine the percentage of an item in an ordered list.
When using this utility for fan speeds, do not include “off”
Given the list: [“low”, “medium”, “high”, “very_high”], this function will return the following when the item is passed in:
low: 25 medium: 50 high: 75 very_high: 100
- aioafero.util.process_range(range_vals: dict) list[Any][source]¶
Process a range to determine what’s supported.
- aioafero.util.float_range(start, stop, step)[source]¶
Create a generator that yields a range as float.
Module contents¶
aioafero API.
- class aioafero.AferoCapability(functionClass: str, type: str, schedulable: bool, functionInstance: str | None = None, _opts: dict[str, ~typing.Any]=<factory>)[source]¶
Bases:
objectCapability of a given device.
- Parameters:
- class aioafero.AferoDevice(id: str, device_id: str, model: str, device_class: str, default_name: str, default_image: str, friendly_name: str, capabilities: list[AferoCapability] = <factory>, functions: list[dict] = <factory>, states: list[AferoState] = <factory>, children: list[str] = <factory>, manufacturerName: str | None = None, split_identifier: str | None = None, version_data: dict[str, str] | None=None)[source]¶
Bases:
objectMapped Device from an API response.
- Parameters:
- capabilities: list[AferoCapability]¶
- states: list[AferoState]¶
- __init__(id: str, device_id: str, model: str, device_class: str, default_name: str, default_image: str, friendly_name: str, capabilities: list[AferoCapability] = <factory>, functions: list[dict] = <factory>, states: list[AferoState] = <factory>, children: list[str] = <factory>, manufacturerName: str | None = None, split_identifier: str | None = None, version_data: dict[str, str] | None=None) None¶
- exception aioafero.AferoError[source]¶
Bases:
ExceptionGeneric exception for Afero API or the responses.
- class aioafero.AferoState(functionClass: str, value: Any, lastUpdateTime: int | None = None, functionInstance: str | None = None)[source]¶
Bases:
objectState of a given function.
- Parameters:
- class aioafero.EventType(*values)[source]¶
Bases:
EnumEnum with possible Events.
- RESOURCE_ADDED = 'add'¶
- RESOURCE_UPDATED = 'update'¶
- RESOURCE_DELETED = 'delete'¶
- RESOURCE_VERSION = 'version'¶
- RESOURCE_UPDATE_RESPONSE = 'update_response'¶
- CONNECTED = 'connected'¶
- DISCONNECTED = 'disconnected'¶
- RECONNECTED = 'reconnected'¶
- INVALID_AUTH = 'invalid_auth'¶
- POLLED_DATA = 'polled_data'¶
- POLLED_DEVICES = 'polled_devices'¶
- exception aioafero.InvalidAuth[source]¶
Bases:
AferoErrorInvalid credentials supplied during authentication.
- exception aioafero.InvalidResponse[source]¶
Bases:
AferoErrorAn invalid response was received from Afero API.
- exception aioafero.OTPError[source]¶
Bases:
AferoErrorIssue occurred with OTP authentication.
- exception aioafero.OTPRequired[source]¶
Bases:
AferoErrorOne-time password is required for login.
- exception aioafero.SecuritySystemError[source]¶
Bases:
AferoErrorGeneric exception for Afero Security System issues.
- class aioafero.TemperatureUnit(*values)[source]¶
Bases:
EnumTemperature unit enum.
- CELSIUS = 'celsius'¶
- FAHRENHEIT = 'fahrenheit'¶
- aioafero.anonymize_device(dev: AferoDevice, parent_mapping: dict, device_links: dict, anon_name: bool) dict[source]¶
Convert an AferoDevice into an anonymized dictionary.
- Parameters:
dev (AferoDevice)
parent_mapping (dict)
device_links (dict)
anon_name (bool)
- Return type:
- aioafero.anonymize_devices(devices: list[AferoDevice], anon_name: bool = False) list[dict][source]¶
Remove identifying information from the device.
- Parameters:
devices (list[AferoDevice]) – List of devices to anonymize
anon_name (bool) – If true, give each device a unique name
- Return type: