No project description provided
Project description
pyESPMega
This library provides a mean of communicating with the ESPMega Programmable Logic Controller through MQTT
Compatibility
This library is compatible with:
- ESPMega R2.4 [2018] (Model e) with IoT FreedomOS v1.2+
- ESPMega R3.0 [2020] (All Model) with IoT Core LT OS V1.4
- ESPMega Plus R1.0 [2020] (All Model) with IoT Core LT+ OS V1.4
- ESPMega R4.0 [2023] (All Model) with IoT Core LT OS V2
- ESPMega PRO R2.0 [2020] (Model c) with IoT Core OS V1
- ESPMega PRO R3.3 [2023] (Model b,c) with IoT Core OS V2.2 (or above)
ESPMega Client Types
There are two type of ESPMega client, ESPMega and ESPMega_standalone
ESPMega
ESPMega class requires you to provide and maintain an MQTT connection
This class takes in a Paho-MQTT Client as an input argument
Import and Initialization
from espmegar3 import ESPMega
plc = ESPMega("/basetopic", MQTT_CLIENT)
ESPMega_standalone
ESPMega_standalone create and maintain the required mqtt connection for you. Import and Initialization
from espmegar3 import ESPMega_standalone as ESPMega
plc = ESPMega("/basetopic", "MQTT_SERVER", MQTT_PORT)
ESPMega Client Functions
- digital_read(pin: int) | Reads the digital value of a pin.
- digital_write(pin: int, state: bool) | Writes a digital value to a pin.
- analog_write(pin: int, state: bool, value: int) | Writes an analog value to a pin.
- dac_write(pin: int, state: bool, value: int) | Writes a DAC value to a pin.
- set_ac_mode(mode: str) | Sets the AC mode. ("off", "fan_only", "cool")
- set_ac_temperature(temperature: int) | Sets the AC temperature.
- set_ac_fan_speed(fan_speed: str) | Sets the AC fan speed.
- get_ac_mode() | Returns the current AC mode.
- get_ac_temperature() | Returns the current AC temperature.
- get_ac_fan_speed() | Returns the current AC fan speed.
- read_room_temperature() | Reads the room temperature.
- read_humidity() | Reads the humidity.
- send_infrared(code: dict) | Sends an infrared code. Codes are a timing interval list in milliseconds
- request_state_update() | Requests an update of the device state.
- get_input_buffer() | Return the state of every input as a list
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
espmega-1.6.tar.gz
(3.9 kB
view hashes)