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(tuple[TelnetReader, TelnetWriter] | None)
- Type:
Connection tuple for telnet.
- udp_socket(socket.socket)
- Type:
UDP socket for communication.
- queue_manager(QueueManager)
- Type:
Manages send and receive queues.
- process_task(Task | None)
- Type:
Task for processing responses.
- device_manager(DeviceManager | None)
- 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(Task | None)
- Type:
Task for reconnecting.
- _telnetclient(IFSEITelnetClient | None)
- Type:
Telnet client.
Initialize an IFSEI device.
- Parameters:
network_config (NetworkConfiguration | None) – 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 (NetworkConfiguration | None) – 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[source]
Load the device manager from the configuration file.
- Parameters:
file (str | None) – Path to the configuration file. If None,
directory. (it will be loaded from the current) –
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) None[source]
Asynchronously update the light state.
- Parameters:
device_id (str) – The device ID.
colors (list) – 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: str) None[source]
Asynchronously update the cover state.
- Parameters:
device_id (str) – The device ID.
address (str) – The address to update.
- Raises:
logger.error – If no device manager is found.:
- async async_change_scene(module_address: str, scene_number: str) None[source]
Asynchronously change the scene.
- Parameters:
module_address (str) – The module address.
scene_number (str) – The scene number.
- async async_toggle_zone(module_address: str, zone_number: str, state: str) None[source]
Asynchronously toggle the zone.
- Parameters:
module_address (str) – The module address.
zone_number (str) – The zone number.
state (str) – The state to set (1 or 0).
- async async_get_scene_status(module_address: str) None[source]
Asynchronously get the scene status.
Args:
module_address (str): The module address.
- async async_set_zone_intensity(module_address: str, channel: str, intensity: int) None[source]
Asynchronously set the zone intensity.
- Parameters:
module_address (str) – The module address.
channel (str) – The channel.
intensity (int) – The intensity to set.
- async async_set_shader_state(module_address: str) None[source]
Asynchronously set the shader state.
- Parameters:
module_address (str) – The module address.
- async async_get_zone_intensity(module_address: str, zone_number: str) None[source]
Asynchronously get the zone intensity.
- Parameters:
module_address (str) – The module address.
zone_number (str) – The zone number.
- async async_increase_scene_intensity(module_address: str) None[source]
Asynchronously increase the scene intensity.
- Parameters:
module_address (str) – The module address.
- async async_decrease_scene_intensity(module_address: str) None[source]
Asynchronously decrease the scene intensity.
- Parameters:
module_address (str) – The module address.
- async async_increase_zone_intensity(module_address: str, zone_number: str) None[source]
Asynchronously increase the zone intensity.
- Parameters:
module_address (str) – The module address.
zone_number (str) – The zone number.
- async async_decrease_zone_intensity(module_address: str, zone_number: str) None[source]
Asynchronously decrease the zone intensity.
- Parameters:
module_address (str) – The module address.
zone_number (str) – The zone number.
- async async_record_scene(module_address: str) None[source]
Asynchronously record a scene.
- Parameters:
module_address (str) – The module address.
- Raises:
NotImplementedError – This feature is not yet implemented.:
- async async_get_module_configuration(module_address: str, setup_number: str) None[source]
Asynchronously get the module configuration.
- Parameters:
module_address (str) – The module address.
setup_number (str) – The setup number.