pyscenario.ifsei
IFSEI Module.
This module contains the IFSEI class, which represents an IFSEI device. It provides methods to manage the connection, send commands, and handle responses from the device.
Classes
|
A class that represents an IFSEI device. |
Documentation
- class pyscenario.ifsei.IFSEI(network_config: NetworkConfiguration | None = None)[source]
Bases:
objectA class that represents an IFSEI device.
- network_config(NetworkConfiguration)
- Type:
Configuration for network settings.
- name(str)
- Type:
Name of the IFSEI device.
- connection(Optional[Tuple[TelnetReader, TelnetWriter]])
- Type:
Connection tuple for telnet.
- queue_manager(QueueManager)
- Type:
Manages send and receive queues.
- process_task(Optional[Task])
- Type:
Task for processing responses.
- device_manager(Optional[DeviceManager])
- Type:
Manages the devices.
- is_connected(bool)
- Type:
Connection status.
- is_closing(bool)
- Type:
Closing status.
- _send_delay(float)
- Type:
Delay for sending commands.
- _reconnect_task(Optional[Task])
- Type:
Task for reconnecting.
- _telnetclient(Optional[IFSEITelnetClient])
- Type:
Telnet client.
Initialize an IFSEI device.
- Parameters:
network_config (Optional[NetworkConfiguration]) – Configuration for network settings. If None, a default configuration is used.
- __init__(network_config: NetworkConfiguration | None = None) None[source]
Initialize an IFSEI device.
- Parameters:
network_config (Optional[NetworkConfiguration]) – Configuration for network settings. If None, a default configuration is used.
- classmethod from_config(config_file: str)[source]
Create an IFSEI object from a configuration file.
- Parameters:
config_file (str) – Path to the configuration file.
- Returns:
IFSEI
- Return type:
An instance of the IFSEI class.
- load_devices(file: str | None = None) None[source]
Load the device manager from the configuration file.
- Parameters:
file (Optional[str]) – Path to the configuration file. If None, it will be loaded from the current directory.
This method loads the device manager using the DEVICE_FILE constant.
- set_reconnect_options(reconnect: bool, delay: float) None[source]
Set the reconnect options for the IFSEI device.
- Parameters:
reconnect (bool) – Whether to reconnect or not.
delay (float) – Delay in seconds between reconnect attempts.
- set_send_delay(delay: float) None[source]
Set the delay for sending commands.
- Parameters:
delay (float) – Delay in seconds.
- async async_connect() bool[source]
Asynchronously connect to the IFSEI device.
- Returns:
bool
- Return type:
True if connection is successful, False otherwise.
- async async_send_command(command: str) None[source]
Asynchronously send a command to the send queue.
- Parameters:
command (str) – The command to send.
- set_protocol(protocol: Protocol = Protocol.TCP) None[source]
Set the protocol to use for communication.
- Parameters:
protocol (Protocol) – The protocol to use (default is TCP).
- get_device_id() str[source]
Get the unique ID of the device.
- Returns:
str
- Return type:
The unique ID of the device.
- set_is_connected(is_available: bool = False) None[source]
Set the connection status.
- Parameters:
is_available (bool) – Connection status (default is False).
- async async_monitor(level: int) None[source]
Asynchronously monitor the network.
- Parameters:
level (int) – Monitoring level (must be between 1 and 7).
- Raises:
ValueError – If the monitoring level is not between 1 and 7.:
- async async_update_light_state(device_id: str, colors: List[int]) None[source]
Asynchronously update the light state.
- Parameters:
device_id (str) – The device ID.
colors (List[int]) – List of colors (must have exactly 4 elements).
- Raises:
ValueError – If the list does not have exactly 4 elements.:
- async async_update_cover_state(device_id: str, address: int) None[source]
Asynchronously update the cover state.
- Parameters:
device_id (str) – The device ID.
address (int) – The address to update.
- async async_change_scene(module_address: int, scene_number: int) None[source]
Asynchronously change the scene.
- Parameters:
module_address (int) – The module address.
scene_number (int) – The scene number.
- async async_toggle_zone(module_address: int, zone_number: int, state: int) None[source]
Asynchronously toggle the zone.
- Parameters:
module_address (int) – The module address.
zone_number (int) – The zone number.
state (int) – The state to set (1 or 0).
- Raises:
ValueError – If state is not 0 or 1.:
- async async_get_scene_status(module_address: int) None[source]
Asynchronously get the scene status.
- Parameters:
module_address (int) – The module address.
- async async_set_zone_intensity(module_address: int, channel: int, intensity: int) None[source]
Asynchronously set the zone intensity.
- Parameters:
module_address (int) – The module address.
channel (int) – The channel number.
intensity (int) – The intensity to set (0-100).
- Raises:
ValueError – If intensity is not between 0 and 100.:
- async async_set_shader_state(module_address: int) None[source]
Asynchronously set the shader state.
- Parameters:
module_address (int) – The module address.
- async async_get_zone_intensity(module_address: int, zone_number: int) None[source]
Asynchronously get the zone intensity.
- Parameters:
module_address (int) – The module address.
zone_number (int) – The zone number.
- async async_increase_scene_intensity(module_address: int) None[source]
Asynchronously increase the scene intensity.
- Parameters:
module_address (int) – The module address.
- async async_decrease_scene_intensity(module_address: int) None[source]
Asynchronously decrease the scene intensity.
- Parameters:
module_address (int) – The module address.
- async async_increase_zone_intensity(module_address: int, zone_number: int) None[source]
Asynchronously increase the zone intensity.
- Parameters:
module_address (int) – The module address.
zone_number (int) – The zone number.
- async async_decrease_zone_intensity(module_address: int, zone_number: int) None[source]
Asynchronously decrease the zone intensity.
- Parameters:
module_address (int) – The module address.
zone_number (int) – The zone number.
- async async_record_scene(module_address: int) None[source]
Asynchronously record a scene.
- Parameters:
module_address (int) – The module address.
- Raises:
NotImplementedError – This method is not yet implemented.:
- async async_get_module_configuration(module_address: int, setup_number: int) None[source]
Asynchronously get the module configuration.
- Parameters:
module_address (int) – The module address.
setup_number (int) – The setup number.