From 7a7c065754c97da4410e04feb2ad3d3a5a44fc54 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 23 Aug 2020 00:49:51 +0200 Subject: [PATCH] Added missing docs --- docs/source/backends.rst | 1 + docs/source/platypush/backend/sensor.dht.rst | 5 +++++ docs/source/platypush/plugins/gpio.sensor.dht.rst | 5 +++++ docs/source/plugins.rst | 1 + platypush/plugins/luma/oled.py | 8 +++++--- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 docs/source/platypush/backend/sensor.dht.rst create mode 100644 docs/source/platypush/plugins/gpio.sensor.dht.rst diff --git a/docs/source/backends.rst b/docs/source/backends.rst index 16517ff024..445ec5c25a 100644 --- a/docs/source/backends.rst +++ b/docs/source/backends.rst @@ -51,6 +51,7 @@ Backends platypush/backend/sensor.arduino.rst platypush/backend/sensor.battery.rst platypush/backend/sensor.bme280.rst + platypush/backend/sensor.dht.rst platypush/backend/sensor.distance.rst platypush/backend/sensor.distance.vl53l1x.rst platypush/backend/sensor.envirophat.rst diff --git a/docs/source/platypush/backend/sensor.dht.rst b/docs/source/platypush/backend/sensor.dht.rst new file mode 100644 index 0000000000..455a639b00 --- /dev/null +++ b/docs/source/platypush/backend/sensor.dht.rst @@ -0,0 +1,5 @@ +``platypush.backend.sensor.dht`` +================================ + +.. automodule:: platypush.backend.sensor.dht + :members: diff --git a/docs/source/platypush/plugins/gpio.sensor.dht.rst b/docs/source/platypush/plugins/gpio.sensor.dht.rst new file mode 100644 index 0000000000..a40a885a82 --- /dev/null +++ b/docs/source/platypush/plugins/gpio.sensor.dht.rst @@ -0,0 +1,5 @@ +``platypush.plugins.gpio.sensor.dht`` +===================================== + +.. automodule:: platypush.plugins.gpio.sensor.dht + :members: diff --git a/docs/source/plugins.rst b/docs/source/plugins.rst index f5f2de4948..1721faf19f 100644 --- a/docs/source/plugins.rst +++ b/docs/source/plugins.rst @@ -45,6 +45,7 @@ Plugins platypush/plugins/gpio.sensor.rst platypush/plugins/gpio.sensor.accelerometer.rst platypush/plugins/gpio.sensor.bme280.rst + platypush/plugins/gpio.sensor.dht.rst platypush/plugins/gpio.sensor.distance.rst platypush/plugins/gpio.sensor.distance.vl53l1x.rst platypush/plugins/gpio.sensor.envirophat.rst diff --git a/platypush/plugins/luma/oled.py b/platypush/plugins/luma/oled.py index 3a7d15ebec..cec30e5db4 100644 --- a/platypush/plugins/luma/oled.py +++ b/platypush/plugins/luma/oled.py @@ -2,9 +2,6 @@ import enum import os from typing import Optional, Union, Tuple, List -import luma.core.interface.serial -import luma.oled.device -from luma.core.render import canvas from PIL import Image, ImageFont from platypush.plugins import Plugin, action @@ -73,6 +70,10 @@ class LumaOledPlugin(Plugin): :param font: Path to a default TTF font used to display the text. :param font_size: Font size - it only applies if ``font`` is set. """ + import luma.core.interface.serial + import luma.oled.device + from luma.core.render import canvas + super().__init__(**kwargs) iface_name = interface @@ -103,6 +104,7 @@ class LumaOledPlugin(Plugin): """ clear the display canvas. """ + from luma.core.render import canvas self.device.clear() del self.canvas self.canvas = canvas(self.device)