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:
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:

PoEInfoModel

Raises:
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:

bool

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

class lannerpsp.PoEInfoModel(number_of_poe_ports: int, power_status: Dict[int, bool])[source]

To store PoE information.

to_dict() Dict[str, Any][source]

Convert to dict.

11.3. Supported Platforms

The following platforms have been verified and confirmed to be supported: