11. API - PoE
11.1. Regular Classes
The following classes are intended for general use with the devices they represent. All classes in this section are concrete (not abstract).
11.1.1. PoE
- class lannerpsp.PoE(num: int)[source]
Power over Ethernet.
- Parameters:
num (int) – LAN port number
- Raises:
TypeError – The input parameters type error.
PSPNotSupport – This function is not supported.
PSPInvalid – The input parameter is out of range.
PSPError – General PSP functional error.
- classmethod get_info() PoEInfoModel [source]
Get the PoE information supported by this platform.
Example:
>>> poe_info = PoE.get_info() >>> poe_info PoEInfoModel(number_of_poe_ports=6, power_status={1: True, 2: False, 3: True, 4: True, 5: True, 6: True}) >>> poe_info.number_of_poe_ports 6 >>> poe_info.power_status {1: True, 2: False, 3: True, 4: True, 5: True, 6: True} >>> poe_info.to_dict() {'number_of_poe_ports': 6, 'power_status': {1: True, 2: True, 3: True, 4: True, 5: True, 6: True}}
- Returns:
The PoE information.
- Return type:
- Raises:
PSPNotSupport – This function is not supported.
PSPNotOpened – Device port is not opened yet.
PSPError – General PSP functional error.
- enable() None [source]
Enable the PoE port power (power on by auto).
Example:
>>> poe1 = PoE(1) >>> poe1.enable()
- Raises:
PSPNotOpened – The library is not ready or opened yet.
PSPError – General PSP functional error.
- disable() None [source]
Disable the PoE port power (power off).
Example:
>>> poe1 = PoE(1) >>> poe1.disable()
- Raises:
PSPNotOpened – The library is not ready or opened yet.
PSPError – General PSP functional error.
- get_power_status() bool [source]
Get the PoE port power status.
Example:
>>> poe1 = PoE(1) >>> poe1.get_power_status() True
- Returns:
PoE LAN port power status.
True
means PoE power is enabled by auto,False
means PoE power is disabled.- Return type:
- Raises:
PSPNotOpened – The library is not ready or opened yet.
PSPError – General PSP functional error.
11.2. Models
The following models are used to store data for data modeling.
11.2.1. PoEInfoModel
11.3. Supported Platforms
The following platforms have been verified and confirmed to be supported: