xs1_api_client.device package¶
Subpackages¶
Module contents¶
-
class
xs1_api_client.device.
XS1Device
(state: dict, api) → None[source]¶ Bases:
object
This is a generic XS1 device, all other objetcs inherit from this.
-
NAME_PATTERN_VALID
= re.compile('^[a-zA-Z0-9_]+$', re.IGNORECASE)¶
-
new_value
()[source]¶ Returns the new value to set for this device. If this value differs from the currrent value the gateway is still trying to update the value on the device. If it does not differ the value has already been set.
Returns: the new value to set for this device
-
set_name
(name: str)[source]¶ Sets a new name for this device. Keep in mind that there are some limitations for a device name.
Parameters: name – the new name to set Returns: the new name of the actuator
-
set_state
(new_state: dict) → None[source]¶ Sets a new state for this device. If there is an existing state, new and old values will be merged to retain any information that was missing from api responses.
Parameters: new_state – new representation of this device (api response)
-
set_value
(value) → None[source]¶ Sets a new value for this device. This method should be implemented by inheriting classes.
Parameters: value – the new value to set
-