aioafero.v1 package¶
Subpackages¶
- aioafero.v1.controllers package
- Submodules
- aioafero.v1.controllers.base module
NumbersNameBaseResourcesControllerBaseResourcesController.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()
dataclass_to_afero()get_afero_states_from_mapped()get_afero_instance_for_state()get_afero_state_from_feature()get_afero_states_from_list()
- aioafero.v1.controllers.climate module
- aioafero.v1.controllers.device module
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()
- aioafero.v1.controllers.event module
BackoffExceptionCallbackResponseEventStreamStatusAferoEventEventStreamEventStream.__init__()EventStream.connectedEventStream.statusEventStream.registered_multiple_devicesEventStream.polling_intervalEventStream.poll_versionEventStream.wait_for_first_poll()EventStream.initialize()EventStream.initialize_discovery()EventStream.initialize_device_polling()EventStream.initialize_processor()EventStream.register_multi_device()EventStream.stop()EventStream.subscribe()EventStream.add_job()EventStream.async_block_until_done()EventStream.emit()EventStream.process_backoff()EventStream.gather_discovery_data()EventStream.generate_devices_from_data()EventStream.split_devices()EventStream.generate_events_from_update()EventStream.generate_events_from_data()EventStream.perform_discovery_poll()EventStream.process_event()
- aioafero.v1.controllers.exhaust_fan module
generate_split_name()get_split_instances()get_valid_states()exhaust_fan_callback()ExhaustFanControllerExhaustFanController.ITEM_TYPE_IDExhaustFanController.ITEM_TYPESExhaustFanController.ITEM_CLSExhaustFanController.ITEM_MAPPINGExhaustFanController.ITEM_SENSORSExhaustFanController.ITEM_BINARY_SENSORSExhaustFanController.ITEM_NUMBERSExhaustFanController.ITEM_SELECTSExhaustFanController.DEVICE_SPLIT_CALLBACKSExhaustFanController.initialize_elem()ExhaustFanController.update_elem()ExhaustFanController.set_state()
- aioafero.v1.controllers.fan module
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()
- aioafero.v1.controllers.light module
process_names()generate_split_name()get_split_instances()state_belongs_to_light_instance()state_matches_instance()resolve_function_instance()get_color_modes_for_device()get_valid_states()light_callback()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()
process_color_temps()process_effects()
- aioafero.v1.controllers.lock module
- aioafero.v1.controllers.portable_ac module
generate_split_name()get_valid_states()portable_ac_callback()PortableACControllerPortableACController.ITEM_TYPE_IDPortableACController.ITEM_TYPESPortableACController.ITEM_CLSPortableACController.ITEM_MAPPINGPortableACController.ITEM_SELECTSPortableACController.DEVICE_SPLIT_CALLBACKSPortableACController.initialize_elem()PortableACController.update_elem()PortableACController.set_state()
- aioafero.v1.controllers.security_system module
get_sensor_ids()generate_sensor_name()get_valid_states()get_model_type()get_valid_functions()get_sensor_name()security_system_callback()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()
- aioafero.v1.controllers.security_system_keypad module
SecuritySystemKeypadControllerSecuritySystemKeypadController.ITEM_TYPE_IDSecuritySystemKeypadController.ITEM_TYPESSecuritySystemKeypadController.ITEM_CLSSecuritySystemKeypadController.ITEM_BINARY_SENSORSSecuritySystemKeypadController.ITEM_SELECTSSecuritySystemKeypadController.initialize_elem()SecuritySystemKeypadController.update_elem()SecuritySystemKeypadController.set_state()
- aioafero.v1.controllers.security_system_sensor module
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()
- aioafero.v1.controllers.switch module
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()
- aioafero.v1.controllers.thermostat module
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()
get_supported_modes()
- 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
ColorModeFeatureColorFeatureColorTemperatureFeatureCurrentPositionEnumCurrentPositionFeatureCurrentTemperatureFeatureDimmingFeatureDirectionFeatureEffectFeatureHVACModeFeatureModeFeatureNumbersFeatureOnFeatureOpenFeaturePresetFeatureSecuritySensorConfigFeatureSelectFeatureSecuritySystemDisarmPinSecuritySensorSirenFeatureSpeedFeatureTargetTemperatureFeature
- aioafero.v1.models.hvac_mixin module
HVACMixinHVACMixin.current_temperatureHVACMixin.fan_runningHVACMixin.fan_modeHVACMixin.hvac_actionHVACMixin.hvac_modeHVACMixin.target_temperature_heatingHVACMixin.target_temperature_coolingHVACMixin.target_temperature_auto_heatingHVACMixin.target_temperature_auto_coolingHVACMixin.target_temperatureHVACMixin.get_mode_to_check()HVACMixin.target_temperature_stepHVACMixin.target_temperature_maxHVACMixin.target_temperature_minHVACMixin.temperatureHVACMixin.__init__()
- aioafero.v1.models.light module
LightLight.typeLight.onLight.colorLight.color_modeLight.color_modesLight.color_temperatureLight.dimmingLight.effectLight.supports_whiteLight.__post_init__()Light.supports_colorLight.supports_color_temperatureLight.supports_color_whiteLight.supports_dimmingLight.supports_effectsLight.supports_onLight.is_onLight.brightnessLight.__init__()
LightPut
- aioafero.v1.models.lock module
- aioafero.v1.models.portable_ac module
- aioafero.v1.models.resource module
ResourceTypesResourceTypes.DEVICEResourceTypes.HOMEResourceTypes.ROOMResourceTypes.EXHAUST_FANResourceTypes.FANResourceTypes.LANDSCAPE_TRANSFORMERResourceTypes.LIGHTResourceTypes.LOCKResourceTypes.PARENT_DEVICEResourceTypes.PORTABLE_ACResourceTypes.POWER_OUTLETResourceTypes.SECURITY_SYSTEMResourceTypes.SECURITY_SYSTEM_KEYPADResourceTypes.SECURITY_SYSTEM_SENSORResourceTypes.SWITCHResourceTypes.THERMOSTATResourceTypes.UNKNOWNResourceTypes.WATER_TIMER
DeviceInformationDeviceInformation.device_classDeviceInformation.default_imageDeviceInformation.default_nameDeviceInformation.manufacturerDeviceInformation.modelDeviceInformation.nameDeviceInformation.parent_idDeviceInformation.wifi_macDeviceInformation.ble_macDeviceInformation.version_dataDeviceInformation.childrenDeviceInformation.functionsDeviceInformation.__init__()
- 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
StandardMixinStandardMixin.availableStandardMixin.device_informationStandardMixin.split_identifierStandardMixin.numbersStandardMixin.selectsStandardMixin.sensorsStandardMixin.binary_sensorsStandardMixin.instancesStandardMixin.__post_init__()StandardMixin.get_instance()StandardMixin.idStandardMixin.instanceStandardMixin.update_idStandardMixin.__init__()
- aioafero.v1.models.switch module
- aioafero.v1.models.thermostat module
ThermostatThermostatPutThermostatPut.fan_modeThermostatPut.hvac_modeThermostatPut.safety_max_tempThermostatPut.safety_min_tempThermostatPut.target_temperature_auto_heatingThermostatPut.target_temperature_auto_coolingThermostatPut.target_temperature_heatingThermostatPut.target_temperature_coolingThermostatPut.__init__()
- aioafero.v1.models.valve module
- Module contents
AferoBinarySensorAferoSensorDeviceDeviceInformationDeviceInformation.device_classDeviceInformation.default_imageDeviceInformation.default_nameDeviceInformation.manufacturerDeviceInformation.modelDeviceInformation.nameDeviceInformation.parent_idDeviceInformation.wifi_macDeviceInformation.ble_macDeviceInformation.version_dataDeviceInformation.childrenDeviceInformation.functionsDeviceInformation.__init__()
ExhaustFanExhaustFanPutFanFanPutLightLight.typeLight.onLight.colorLight.color_modeLight.color_modesLight.color_temperatureLight.dimmingLight.effectLight.supports_whiteLight.__post_init__()Light.supports_colorLight.supports_color_temperatureLight.supports_color_whiteLight.supports_dimmingLight.supports_effectsLight.supports_onLight.is_onLight.brightnessLight.__init__()
LightPutLockLockPutPortableACPortableACPutResourceTypesResourceTypes.DEVICEResourceTypes.HOMEResourceTypes.ROOMResourceTypes.EXHAUST_FANResourceTypes.FANResourceTypes.LANDSCAPE_TRANSFORMERResourceTypes.LIGHTResourceTypes.LOCKResourceTypes.PARENT_DEVICEResourceTypes.PORTABLE_ACResourceTypes.POWER_OUTLETResourceTypes.SECURITY_SYSTEMResourceTypes.SECURITY_SYSTEM_KEYPADResourceTypes.SECURITY_SYSTEM_SENSORResourceTypes.SWITCHResourceTypes.THERMOSTATResourceTypes.UNKNOWNResourceTypes.WATER_TIMER
SecuritySystemSecuritySystemKeypadSecuritySystemKeypadPutSecuritySystemPutSecuritySystemSensorSecuritySystemSensorPutSwitchSwitchPutThermostatThermostatPutThermostatPut.fan_modeThermostatPut.hvac_modeThermostatPut.safety_max_tempThermostatPut.safety_min_tempThermostatPut.target_temperature_auto_heatingThermostatPut.target_temperature_auto_coolingThermostatPut.target_temperature_heatingThermostatPut.target_temperature_coolingThermostatPut.__init__()
ValveValvePut
Submodules¶
aioafero.v1.auth module¶
Handle authentication to Afero API.
- class aioafero.v1.auth.AferoAuth(session: ClientSession, username: str, refresh_token: str, *, token: str | None = None, token_expiration: float | None = None, hide_secrets: bool = True, afero_client: str = 'hubspace', client_name: str = 'aioafero')[source]¶
Bases:
objectAuthentication against the Afero IoT API.
This class follows the Afero IoT authentication workflow and utilizes refresh tokens.
Construct runtime instances with
AferoAuth(session, username, refresh_token, ...)or usefor_login()for credential-based login.- Parameters:
- __init__(session: ClientSession, username: str, refresh_token: str, *, token: str | None = None, token_expiration: float | None = None, hide_secrets: bool = True, afero_client: str = 'hubspace', client_name: str = 'aioafero') None[source]¶
Initialize auth for refresh-token runtime flows; use
for_login()for credentials.- Parameters:
session (ClientSession) – Shared
aiohttp.ClientSessionfor OpenID and token requests.username (str) – Afero-backed account username.
refresh_token (str) – OAuth refresh token from login or storage.
token (str | None) – Optional non-expired bearer token to skip the initial refresh.
token_expiration (float | None) – Unix timestamp when
tokenexpires; omit withtokento refresh on first API use.hide_secrets (bool) – Redact sensitive values from logs.
afero_client (str) – Afero client identifier (default
hubspace).client_name (str) – User-Agent token for auth requests.
- Return type:
None
- classmethod for_login(session: ClientSession, username: str, password: str, *, afero_client: str = 'hubspace', hide_secrets: bool = True, client_name: str = 'aioafero') AferoAuth[source]¶
Create an auth instance for credential-based login flows.
- set_token_data(data: TokenData) None[source]¶
Set the current token data.
When
hide_secretsis True (default), updates the securelogging registry: removes old token values not reused indata, then registers new ones. Whenhide_secretsis False, only_token_datais replaced (no registry changes); DEBUG logs may expose secrets.- Parameters:
data (TokenData)
- Return type:
None
- async webapp_login(challenge: AuthChallenge) str[source]¶
Perform login to the webapp for a code.
Login to the webapp and generate a code used for generating tokens.
- Parameters:
challenge (AuthChallenge) – Challenge data for connection and approving
- Returns:
Code used for generating a refresh token
- Return type:
- async static generate_challenge_data() AuthChallenge[source]¶
Generate data to send to Afero API when logging into the system.
- Return type:
AuthChallenge
- async generate_code(data: AuthSessionData, challenge: AuthChallenge) str[source]¶
Finalize login to Afero IoT page.
- Parameters:
session_code – Session code during form interaction
execution – Session code during form interaction
tab_id – Session code during form interaction
data (AuthSessionData)
challenge (AuthChallenge)
- Returns:
code for generating tokens
- Return type:
- async static parse_code(response: ClientResponse) str[source]¶
Parse the code for generating tokens.
- Parameters:
response (ClientResponse)
- Return type:
- async generate_refresh_token(challenge: AuthChallenge | None = None, code: str | None = None) TokenData[source]¶
Generate a refresh token.
If a challenge is provided, it will send the correct data. If no challenge is required, it will use the existing refresh token.
- async perform_initial_login() TokenData[source]¶
Login to generate a refresh token.
- Returns:
Refresh token for the auth
- Return type:
- async perform_otp_login(otp_code: str) TokenData[source]¶
Perform otp login to generate a refresh token.
aioafero.v1.v1_const module¶
Constants for accessing Afero API.
Module contents¶
Controls Hubspace devices on v1 API.
- class aioafero.v1.AferoAuth(session: ClientSession, username: str, refresh_token: str, *, token: str | None = None, token_expiration: float | None = None, hide_secrets: bool = True, afero_client: str = 'hubspace', client_name: str = 'aioafero')[source]¶
Bases:
objectAuthentication against the Afero IoT API.
This class follows the Afero IoT authentication workflow and utilizes refresh tokens.
Construct runtime instances with
AferoAuth(session, username, refresh_token, ...)or usefor_login()for credential-based login.- Parameters:
- __init__(session: ClientSession, username: str, refresh_token: str, *, token: str | None = None, token_expiration: float | None = None, hide_secrets: bool = True, afero_client: str = 'hubspace', client_name: str = 'aioafero') None[source]¶
Initialize auth for refresh-token runtime flows; use
for_login()for credentials.- Parameters:
session (ClientSession) – Shared
aiohttp.ClientSessionfor OpenID and token requests.username (str) – Afero-backed account username.
refresh_token (str) – OAuth refresh token from login or storage.
token (str | None) – Optional non-expired bearer token to skip the initial refresh.
token_expiration (float | None) – Unix timestamp when
tokenexpires; omit withtokento refresh on first API use.hide_secrets (bool) – Redact sensitive values from logs.
afero_client (str) – Afero client identifier (default
hubspace).client_name (str) – User-Agent token for auth requests.
- Return type:
None
- classmethod for_login(session: ClientSession, username: str, password: str, *, afero_client: str = 'hubspace', hide_secrets: bool = True, client_name: str = 'aioafero') AferoAuth[source]¶
Create an auth instance for credential-based login flows.
- set_token_data(data: TokenData) None[source]¶
Set the current token data.
When
hide_secretsis True (default), updates the securelogging registry: removes old token values not reused indata, then registers new ones. Whenhide_secretsis False, only_token_datais replaced (no registry changes); DEBUG logs may expose secrets.- Parameters:
data (TokenData)
- Return type:
None
- async webapp_login(challenge: AuthChallenge) str[source]¶
Perform login to the webapp for a code.
Login to the webapp and generate a code used for generating tokens.
- Parameters:
challenge (AuthChallenge) – Challenge data for connection and approving
- Returns:
Code used for generating a refresh token
- Return type:
- async static generate_challenge_data() AuthChallenge[source]¶
Generate data to send to Afero API when logging into the system.
- Return type:
AuthChallenge
- async generate_code(data: AuthSessionData, challenge: AuthChallenge) str[source]¶
Finalize login to Afero IoT page.
- Parameters:
session_code – Session code during form interaction
execution – Session code during form interaction
tab_id – Session code during form interaction
data (AuthSessionData)
challenge (AuthChallenge)
- Returns:
code for generating tokens
- Return type:
- async static parse_code(response: ClientResponse) str[source]¶
Parse the code for generating tokens.
- Parameters:
response (ClientResponse)
- Return type:
- async generate_refresh_token(challenge: AuthChallenge | None = None, code: str | None = None) TokenData[source]¶
Generate a refresh token.
If a challenge is provided, it will send the correct data. If no challenge is required, it will use the existing refresh token.
- async perform_initial_login() TokenData[source]¶
Login to generate a refresh token.
- Returns:
Refresh token for the auth
- Return type:
- async perform_otp_login(otp_code: str) TokenData[source]¶
Perform otp login to generate a refresh token.
- class aioafero.v1.AferoBridgeV1(username: str, refresh_token: str, session: ClientSession, *, token: str | None = None, token_expiration: float | None = None, polling_interval: int = 30, discovery_interval: int = 3600, afero_client: str | None = 'hubspace', hide_secrets: bool = True, poll_version: bool = True, client_name: str | None = 'aioafero', temperature_unit: TemperatureUnit = TemperatureUnit.CELSIUS)[source]¶
Bases:
objectControls Afero IoT devices on v1 API.
This class serves as the main entry point for interacting with the Afero API. It handles authentication, device discovery, state management, and event handling.
- Parameters:
username (str) – The username for the Afero-backed account (e.g., Hubspace).
refresh_token (str) – The OAuth refresh token for the account.
token (str | None) – An optional non-expired bearer token to skip the initial refresh.
token_expiration (float | None) – Unix timestamp when
tokenexpires (omit to refresh immediately on first API use).session (ClientSession) –
aiohttp.ClientSessionfor API and auth traffic (required).polling_interval (int) – The interval in seconds between polling the Afero API for device state updates. Defaults to 30 seconds.
discovery_interval (int) – The interval in seconds between polling the Afero API for new devices. Defaults to 3600 seconds (1 hour).
afero_client (str | None) – The Afero client identifier (
"hubspace"). Defaults to “hubspace”.hide_secrets (bool) – If True, sensitive information will be redacted from logs. Defaults to True.
poll_version (bool) – If True, device version information will be polled periodically. Defaults to True.
client_name (str | None) – A name for the client to be used in the User-Agent header. Defaults to “aioafero”.
temperature_unit (TemperatureUnit) – The desired temperature unit for API responses. Defaults to TemperatureUnit.CELSIUS.
- __init__(username: str, refresh_token: str, session: ClientSession, *, token: str | None = None, token_expiration: float | None = None, polling_interval: int = 30, discovery_interval: int = 3600, afero_client: str | None = 'hubspace', hide_secrets: bool = True, poll_version: bool = True, client_name: str | None = 'aioafero', temperature_unit: TemperatureUnit = TemperatureUnit.CELSIUS)[source]¶
Initialize the AferoBridgeV1 instance.
sessionis required._close_sessiondefaults toFalse; onlyopen()sets it toTruewhen it creates the session internally.
- property events: EventStream¶
Get the class that handles getting new data and notifying controllers.
- add_device(device_id: str, controller: BaseResourcesController[AferoResource]) None[source]¶
Add a device to the list of known devices and map it to its controller.
- Parameters:
device_id (str) – The unique identifier of the device.
controller (BaseResourcesController[AferoResource]) – The controller instance responsible for the device.
- Return type:
None
- get_device_controller(device_id: str) BaseResourcesController[source]¶
Get the controller for a given device.
- Parameters:
device_id (str)
- Return type:
- remove_device(device_id: str) None[source]¶
Remove a device from the list of known devices.
- Parameters:
device_id (str) – The unique identifier of the device to remove.
- Return type:
None
- add_afero_dev(device: AferoDevice, device_id: str | None = None) None[source]¶
Add a raw AferoDevice object to the internal cache.
- Parameters:
device (AferoDevice) – The AferoDevice object to cache.
device_id (str | None) – The ID to use for caching. If None, device.id is used.
- Return type:
None
- get_afero_device(device_id: str) AferoDevice | None[source]¶
Get the raw AferoDevice object for a given ID.
- Parameters:
device_id (str) – The unique identifier of the device.
- Returns:
The AferoDevice object if found, otherwise raises DeviceNotFound.
- Raises:
DeviceNotFound – If the device with the given ID is not found.
- Return type:
AferoDevice | None
- resolve_metadevice_id(device_id: str) str[source]¶
Return the Afero API metadevice ID used for state queries and updates.
- add_controller(name: str, controller_type: type) None[source]¶
Add and instantiate a controller.
The instantiated controller will be available as an attribute on the bridge instance with the provided name.
- set_token_data(data: TokenData) None[source]¶
Set TokenData used for querying the API.
Delegates to
set_token_data()(including secret registry updates whenhide_secretsis enabled on the bridge).- Parameters:
data (TokenData) – The TokenData object to set.
- Return type:
None
- set_polling_interval(polling_interval: int) None[source]¶
Set the time between polling Afero API.
- Parameters:
polling_interval (int) – The polling interval in seconds.
- Return type:
None
- async __aexit__(exc_type, exc_val, exc_tb) None[source]¶
Exit async context:
await bridge.close().- Return type:
None
- async classmethod open(username: str, refresh_token: str, session: ClientSession | None = None, *, token: str | None = None, token_expiration: float | None = None, polling_interval: int = 30, discovery_interval: int = 3600, afero_client: str | None = 'hubspace', hide_secrets: bool = True, poll_version: bool = True, client_name: str | None = 'aioafero', temperature_unit: TemperatureUnit = TemperatureUnit.CELSIUS) Self[source]¶
Create a bridge, initialize it, and wait for the first poll to finish.
Caller is responsible for
await bridge.close()when not usingasync with.If you use
async withon a bridge returned fromopen,__aenter__callsinitialize()again but that is a no-op when polling tasks already exist; only__aexit__(close()) matters for cleanup.- Parameters:
username (str) – Afero-backed account username.
refresh_token (str) – OAuth refresh token from login or storage.
session (ClientSession | None) – Optional shared
aiohttp.ClientSession.token (str | None) – Optional non-expired bearer token.
token_expiration (float | None) – Unix timestamp when
tokenexpires.polling_interval (int) – Seconds between state polls.
discovery_interval (int) – Seconds between discovery polls.
afero_client (str | None) – Afero client identifier (default
hubspace).hide_secrets (bool) – Redact sensitive values from logs.
poll_version (bool) – Periodically fetch firmware version metadata.
client_name (str | None) – User-Agent token.
temperature_unit (TemperatureUnit) – Unit for temperature API responses.
- Returns:
Initialized bridge with controllers populated from the first discovery poll.
- Return type:
- subscribe(callback: Callable[[EventType, dict | None], None]) Callable[source]¶
Register a callback for resource changes on all initialized controllers.
The cloud API is polled on
polling_interval; when state changes, controllers merge updates and invokecallback(event_type, item)in-process.itemis the controller’s resource model (Fan,Light, etc.).
- async get_account_id() str[source]¶
Lookup the account ID associated with the login.
- Returns:
The account ID.
- Raises:
AferoError – If no account ID is found in the API response.
- Return type:
- async initialize() None[source]¶
Initialize the bridge for communication with Afero API.
To ensure the bridge is fully initialized, call async_block_until_done().
- Return type:
None
- async fetch_discovery_data(version_poll=False) list[dict[Any, str]][source]¶
Query the API for all device data.
- async fetch_device_states(device_id) list[dict[Any, str]][source]¶
Query the API for new device states.
- async fetch_all_device_states() list[AferoDevice][source]¶
Query the API for all known device states.
- Returns:
A list of AferoDevice objects with updated states.
- Return type:
- async get_device_version(device_id: str) dict[source]¶
Query the API for device version information.
- create_request(method: str, url: str, include_token: bool, **kwargs) Generator[ClientResponse, None, None][source]¶
Create and manage an aiohttp request.
This is an async context manager that attaches authentication headers when requested and yields the response from the bridge’s session.
- async request(method: str, url: str, include_token: bool = True, **kwargs) ClientResponse[source]¶
Make a request to the API with automatic retries.
- Parameters:
- Returns:
The aiohttp.ClientResponse object.
- Raises:
ExceededMaximumRetries – If the request fails after all retries.
- Return type:
ClientResponse
- async send_service_request(device_id: str, states: list[dict[str, Any]])[source]¶
Manually send state requests to Afero IoT.
- get_headers(**kwargs)[source]¶
Get default headers for an API call.
- Parameters:
kwargs – Additional headers to include.
- Returns:
A dictionary of headers.
- add_job(task: Task) None[source]¶
Add a job to be processed.
- Parameters:
task (Task)
- Return type:
None
- async initialize_cleanup() None[source]¶
Start the background task that cleans up completed ad-hoc tasks.
- Return type:
None
- async adjust_temperature_unit(temperature_unit: TemperatureUnit) None[source]¶
Adjust the temperature unit for API responses.
- Parameters:
temperature_unit (TemperatureUnit) – The desired temperature unit for API responses.
- Return type:
None
- type aioafero.v1.AferoController = DeviceController | FanController | LightController | LockController | AferoSensor | SwitchController | ThermostatController | ValveController | ExhaustFanController | PortableACController | SecuritySystemController | SecuritySystemKeypadController | SecuritySystemSensorController¶
- type aioafero.v1.AferoModelResource = Device | Fan | Light | Lock | Switch | Valve | Thermostat | AferoBinarySensor | AferoSensor | ExhaustFan | PortableAC | SecuritySystem | SecuritySystemSensor¶
- class aioafero.v1.BaseResourcesController(bridge: AferoBridgeV1)[source]¶
Bases:
GenericBase controller for device types registered on
AferoBridgeV1.Subclasses expose typed models and action methods. Use
get_deviceto read state andsubscribefor update callbacks.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = None¶
- ITEM_TYPES: list[ResourceTypes] | None = None¶
- ITEM_CLS = None¶
- __init__(bridge: AferoBridgeV1) None[source]¶
Initialize instance.
- Parameters:
bridge (AferoBridgeV1)
- Return type:
None
- __getitem__(device_id: str) AferoResource[source]¶
Get item by device_id.
- Parameters:
device_id (str)
- Return type:
AferoResource
- property subscribers: dict[str, list[tuple[Callable[[EventType, dict | None], None], tuple[EventType] | None]]]¶
Get all subscribers aligned to this controller.
- async emit_to_subscribers(evt_type: EventType, item_id: str, item: AferoResource)[source]¶
Emit updates to subscribers.
- get_filtered_devices(initial_data: list[dict]) list[AferoDevice][source]¶
Determine devices that align to the controller.
- Parameters:
- Return type:
- async initialize() None[source]¶
Initialize controller the controller.
Initialization process should only occur once. During this process, it will subscribe to all updates for the given resources and register any device split callbacks for the event controller.
- Return type:
None
- async initialize_number(func_def: dict, state: AferoState) tuple[tuple[str, str | None], NumbersFeature] | None[source]¶
Initialize a number from the provided data.
- Parameters:
func_def (dict)
state (AferoState)
- Return type:
tuple[tuple[str, str | None], NumbersFeature] | None
- async initialize_select(functions: list[dict], state: AferoState) tuple[tuple[str, str | None], SelectFeature] | None[source]¶
Initialize a select from the provided data.
- Parameters:
state (AferoState)
- Return type:
tuple[tuple[str, str | None], SelectFeature] | None
- async initialize_sensor(state: AferoState, child_id: str) AferoSensor | AferoBinarySensor | None[source]¶
Initialize the sensor.
- Parameters:
state (AferoState) – State to update
child_id (str) – device_id of the parent device
- Return type:
AferoSensor | AferoBinarySensor | None
- async update_number(state: AferoState, cur_item: AferoResource) str | None[source]¶
Update the number if its tracked and a change has been detected.
- Parameters:
state (AferoState) – State to update
cur_item (AferoResource) – Current item to update
- Returns:
Identifier of the number that was updated or None
- Return type:
str | None
- async update_select(state: AferoState, cur_item: AferoResource) str | None[source]¶
Update the select if its tracked and a change has been detected.
- Parameters:
state (AferoState) – State to update
cur_item (AferoResource) – Current item to update
- Returns:
Identifier of the select that was updated or None
- Return type:
str | None
- async update_sensor(state: AferoState, cur_item: AferoResource) str | None[source]¶
Update the sensor if its tracked and a change has been detected.
- Parameters:
state (AferoState) – State to update
cur_item (AferoResource) – Current item to update
- Returns:
Identifier of the sensor that was updated or None
- Return type:
str | None
- async split_sensor_data(state: AferoState) tuple[Any, str | None][source]¶
Split the sensor value and return a tuple of the sensor value and key.
- Parameters:
state (AferoState)
- Return type:
- async initialize_elem(element: AferoDevice) None[source]¶
Initialize the element.
- Parameters:
afero_device – Afero Device that contains the updated states
element (AferoDevice)
- Returns:
Newly initialized resource
- Return type:
None
- async update_elem(element: AferoDevice) None[source]¶
Update the Portable AC with the latest API data.
- Parameters:
afero_device – Afero Device that contains the updated states
element (AferoDevice)
- Returns:
States that have been modified
- Return type:
None
- subscribe(callback: Callable[[EventType, dict | None], None], id_filter: str | tuple[str] | None = None, event_filter: EventType | tuple[EventType] | None = None) Callable[source]¶
Subscribe to status changes for this resource type.
- Parameters:
- Returns:
function to unsubscribe.
- Return type:
- async update_afero_api(device_id: str, states: list[dict]) ClientResponse | bool[source]¶
Update Afero IoT API with the new states.
- async update(device_id: str, obj_in: AferoResource | None = None, states: list[dict] | None = None, send_duplicate_states: bool = False) ClientResponse | None[source]¶
Update Afero IoT with the new data.
- generate_update_dev(device_id: str, states: list[AferoState]) AferoDevice[source]¶
Generate update data for the event controller.
- Parameters:
device_id (str)
states (list[AferoState])
- Return type:
- get_device(device_id: str) AferoResource[source]¶
Return the current model for a tracked device.
- Parameters:
device_id (str) – Device ID on this controller (split or parent metadevice ID).
- Returns:
Resource model with parsed feature state.
- Raises:
DeviceNotFound – If
device_idis not tracked by this controller.- Return type:
AferoResource
- class aioafero.v1.DeviceController(*args, **kwargs)[source]¶
Bases:
BaseResourcesController[Device]Top-level / parent devices on
bridge.devices(read-only).- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = []¶
- async initialize_elem(afero_device: AferoDevice) Device[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async initialize() None[source]¶
Initialize controller by fetching all items for this resource type from bridge.
- Return type:
None
- get_filtered_devices(devices: list[AferoDevice]) list[AferoDevice][source]¶
Find parent devices.
- Parameters:
devices (list[AferoDevice])
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Device with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- class aioafero.v1.FanController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[Fan]Fan devices on
bridge.fans.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.FAN]¶
- async turn_on(device_id: str) None[source]¶
Turn on the fan.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async turn_off(device_id: str) None[source]¶
Turn off the fan.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async set_preset(device_id: str, preset: bool) None[source]¶
Enable or disable the comfort-breeze preset.
- async initialize_elem(afero_device: AferoDevice) Fan[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Fan with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- class aioafero.v1.LightController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[Light]Light devices on
bridge.lights(including split zones).- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.LIGHT]¶
- ITEM_MAPPING: dict = {'color': 'color-rgb', 'color_mode': 'color-mode', 'color_temperature': 'color-temperature', 'dimming': 'brightness', 'effect': 'color-sequence'}¶
- ITEM_NUMBERS: dict[tuple[str, str | None], NumbersName] = {('speed', 'color-sequence'): ('speed', None)}¶
- async turn_on(device_id: str) None[source]¶
Turn on the light.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async turn_off(device_id: str) None[source]¶
Turn off the light.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async set_color_temperature(device_id: str, temperature: int) None[source]¶
Set color temperature or white mode when CCT is unavailable.
- async set_white(device_id: str, *, on: bool | None = True, brightness: int | None = None) None[source]¶
Set white mode without a color-temperature function.
- async set_brightness(device_id: str, brightness: int) None[source]¶
Set brightness, turning the light on if needed.
- async set_rgb(device_id: str, red: int, green: int, blue: int) None[source]¶
Set RGB color, turning the light on if needed.
- async set_effect(device_id: str, effect: str) None[source]¶
Set a color sequence effect, turning the light on if needed.
- async initialize_elem(afero_device: AferoDevice) Light[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Light with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- async update_elem_color(cur_item: Light, color_seq_states: dict) set[source]¶
Perform the update for effects.
- async set_state(device_id: str, on: bool | None = None, temperature: int | None = None, brightness: int | None = None, color_mode: str | None = None, color: tuple[int, int, int] | None = None, effect: str | None = None, force_white_mode: int | None = None, numbers: dict[tuple[str, str], float] | None = None) None[source]¶
Update light state in the cloud.
- Parameters:
device_id (str) – Device ID from this controller.
on (bool | None) – Power state.
temperature (int | None) – Color temperature in kelvin.
brightness (int | None) – Brightness percentage.
color_mode (str | None) – API color mode (
white,color,sequence, etc.).color (tuple[int, int, int] | None) – RGB tuple
(red, green, blue).effect (str | None) – Named color sequence effect.
force_white_mode (int | None) – Brightness to apply after forcing white mode.
numbers (dict[tuple[str, str], float] | None) – Number features keyed by
(functionClass, functionInstance).
- Return type:
None
- class aioafero.v1.LockController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[Lock]Lock devices on
bridge.locks.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.LOCK]¶
- async lock(device_id: str) None[source]¶
Engage the lock.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async unlock(device_id: str) None[source]¶
Disengage the lock.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async initialize_elem(afero_device: AferoDevice) Lock[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Lock with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- async set_state(device_id: str, lock_position: CurrentPositionEnum | None = None) None[source]¶
Update lock state in the cloud.
- Parameters:
device_id (str) – Device ID from this controller.
lock_position (CurrentPositionEnum | None) – Target lock position (
LOCKING/UNLOCKING).
- Return type:
None
- exception aioafero.v1.OTPRequired[source]¶
Bases:
AferoErrorOne-time password is required for login.
- class aioafero.v1.PortableACController(bridge: AferoBridgeV1)[source]¶
Bases:
ClimateController[PortableAC]Portable air conditioners on
bridge.portable_acs.The power toggle is split onto
bridge.switches.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.PORTABLE_AC]¶
- ITEM_CLS¶
alias of
PortableAC
- ITEM_SELECTS: dict[tuple[str, str | None], str] = {('air-swing', None): 'Swing', ('fan-speed', 'ac-fan-speed'): 'Fan Speed', ('sleep', None): 'Sleep Mode'}¶
- DEVICE_SPLIT_CALLBACKS: dict[str, callable] = {'portable-air-conditioner': <function portable_ac_callback>}¶
- async initialize_elem(afero_device: AferoDevice) PortableAC[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Portable AC with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- async set_state(device_id: str, **kwargs) None[source]¶
Update portable AC climate state in the cloud.
- Parameters:
device_id (str) – Device ID from this controller.
hvac_mode – HVAC mode name from
hvac_mode.supported_modes.target_temperature – Cooling setpoint shorthand.
target_temperature_cooling – Cooling setpoint.
target_temperature_heating – Heating setpoint (when supported).
selects – Select features keyed by
(functionClass, functionInstance).**kwargs – Remaining climate fields forwarded to
set_climate_state.
- Return type:
None
- class aioafero.v1.SecuritySystemController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[SecuritySystem]Security systems on
bridge.security_systems.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.SECURITY_SYSTEM]¶
- ITEM_CLS¶
alias of
SecuritySystem
- ITEM_NUMBERS: dict[tuple[str, str | None], NumbersName] = {('arm-exit-delay', 'away'): ('seconds', 'Arm Exit Delay Away'), ('arm-exit-delay', 'stay'): ('seconds', 'Arm Exit Delay Home'), ('disarm-entry-delay', None): ('seconds', 'Disarm Entry Delay'), ('siren-alarm-timeout', None): ('seconds', 'Siren Timeout'), ('temporary-bypass-time', None): ('seconds', 'Bypass Time')}¶
- ITEM_SELECTS: dict[tuple[str, str | None], str] = {('bypass-allowed', None): 'Enable Temporary Bypass', ('song-id', 'alarm'): 'Alarm Noise', ('song-id', 'chime'): 'Chime Noise', ('volume', 'chime'): 'Chime Volume', ('volume', 'entry-delay'): 'Entry Delay Volume', ('volume', 'exit-delay-away'): 'Exit Delay Volume Away', ('volume', 'exit-delay-stay'): 'Exit Delay Volume Home', ('volume', 'siren'): 'Alarm Volume'}¶
- DEVICE_SPLIT_CALLBACKS: dict[str, callable] = {'security-system-sensor': <function security_system_callback>}¶
- async arm_home(device_id: str) None[source]¶
Arm the system in home mode.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async arm_away(device_id: str) None[source]¶
Arm the system in away mode.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async alarm_trigger(device_id: str) None[source]¶
Manually trigger the alarm siren.
- Parameters:
device_id (str) – Device ID from this controller.
- Return type:
None
- async initialize_elem(afero_device: AferoDevice) SecuritySystem[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Security System with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- async set_state(device_id: str, disarm_pin: int | None = None, command: int | None = None, numbers: dict[tuple[str, str | None], float] | None = None, selects: dict[tuple[str, str | None], str] | None = None) None[source]¶
Update security system state in the cloud.
- Parameters:
device_id (str) – Device ID from this controller.
disarm_pin (int | None) – PIN for disarm commands.
command (int | None) – Panel command code (
2away,4home,5alarm trigger).numbers (dict[tuple[str, str | None], float] | None) – Number features keyed by
(functionClass, functionInstance).selects (dict[tuple[str, str | None], str] | None) – Select features keyed by
(functionClass, functionInstance).
- Return type:
None
- async refresh_alarm_state(device_id: str) None[source]¶
Refresh the alarm state after alarm state change command.
- Parameters:
device_id (str)
- Return type:
None
- class aioafero.v1.SecuritySystemKeypadController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[SecuritySystemKeypad]Security keypads on
bridge.security_systems_keypads.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.SECURITY_SYSTEM_KEYPAD]¶
- ITEM_CLS¶
alias of
SecuritySystemKeypad
- async initialize_elem(afero_device: AferoDevice) SecuritySystemKeypad[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Security System with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- class aioafero.v1.SecuritySystemSensorController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[SecuritySystemSensor]Security sensors split from a system on
bridge.security_systems_sensors.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.SECURITY_SYSTEM_SENSOR]¶
- ITEM_CLS¶
alias of
SecuritySystemSensor
- SENSOR_TYPES = {1: 'Motion Sensor', 2: 'Door/Window Sensor'}¶
- ITEM_SELECTS: dict[tuple[str, str | None], str] = {('bypassType', None): 'Bypass', ('chirpMode', None): 'Chime', ('triggerType', None): 'Alarming State'}¶
- async initialize_elem(device: AferoDevice)[source]¶
Initialize the element.
- Parameters:
afero_device – Afero Device that contains the updated states
device (AferoDevice)
- Returns:
Newly initialized resource
- async update_elem(afero_device: AferoDevice) set[str][source]¶
Update the Security System Sensor with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- class aioafero.v1.SwitchController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[Switch]Switch devices on
bridge.switches.A switch can have one or more toggleable elements controlled by
instance.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.SWITCH, ResourceTypes.POWER_OUTLET, ResourceTypes.LANDSCAPE_TRANSFORMER]¶
- async initialize_elem(afero_device: AferoDevice) Switch[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Switch with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- class aioafero.v1.ThermostatController(bridge: AferoBridgeV1)[source]¶
Bases:
ClimateController[Thermostat]Thermostat devices on
bridge.thermostats.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.THERMOSTAT]¶
- ITEM_CLS¶
alias of
Thermostat
- ITEM_BINARY_SENSORS: dict[str, str] = {'filter-replacement': 'replacement-needed', 'max-temp-exceeded': 'alerting', 'min-temp-exceeded': 'alerting'}¶
- async initialize_elem(afero_device: AferoDevice) Thermostat[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Thermostat with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type:
- async set_target_temperature(device_id: str, target_temperature: float) None[source]¶
Set target temperature for the active heat/cool mode.
- async set_temperature_range(device_id: str, temp_low: float, temp_high: float) None[source]¶
Set auto-mode heating/cooling setpoints.
- async set_state(device_id: str, fan_mode: str | None = None, hvac_mode: str | None = None, safety_max_temp: float | None = None, safety_min_temp: float | None = None, target_temperature_auto_heating: float | None = None, target_temperature_auto_cooling: float | None = None, target_temperature_heating: float | None = None, target_temperature_cooling: float | None = None, **kwargs) None[source]¶
Update thermostat state in the cloud.
- Parameters:
device_id (str) – Device ID from this controller.
fan_mode (str | None) – Fan mode name.
hvac_mode (str | None) – HVAC mode name.
safety_max_temp (float | None) – Maximum safety cutoff temperature.
safety_min_temp (float | None) – Minimum safety cutoff temperature.
target_temperature_auto_heating (float | None) – Auto-mode heating setpoint.
target_temperature_auto_cooling (float | None) – Auto-mode cooling setpoint.
target_temperature_heating (float | None) – Heating setpoint.
target_temperature_cooling (float | None) – Cooling setpoint.
target_temperature – Shorthand applied to the active heat/cool setpoint.
**kwargs – Remaining climate fields forwarded to
set_climate_state.
- Return type:
None
- class aioafero.v1.TokenData(token: str | None, access_token: str | None, refresh_token: str, expiration: float)[source]¶
Bases:
NamedTupleData related to the current token.
- class aioafero.v1.ValveController(bridge: AferoBridgeV1)[source]¶
Bases:
BaseResourcesController[Valve]Valve / water-timer devices on
bridge.valves.Valves can have multiple toggleable elements controlled by
instance.- Parameters:
bridge (AferoBridgeV1)
- ITEM_TYPE_ID: ResourceTypes | None = 'metadevice.device'¶
- ITEM_TYPES: list[ResourceTypes] | None = [ResourceTypes.WATER_TIMER]¶
- async initialize_elem(afero_device: AferoDevice) Valve[source]¶
Initialize the element.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
Newly initialized resource
- Return type:
- async update_elem(afero_device: AferoDevice) set[source]¶
Update the Valve with the latest API data.
- Parameters:
afero_device (AferoDevice) – Afero Device that contains the updated states
- Returns:
States that have been modified
- Return type: