boneIO 0.1.0.dev11__tar.gz → 0.1.0.dev13__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/PKG-INFO +2 -2
  2. boneio-0.1.0.dev13/boneio/sensor/__init__.py +4 -0
  3. boneio-0.1.0.dev13/boneio/sensor/lm75.py +45 -0
  4. boneio-0.1.0.dev13/boneio/version.py +2 -0
  5. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio.egg-info/PKG-INFO +2 -2
  6. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio.egg-info/SOURCES.txt +3 -1
  7. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio.egg-info/requires.txt +2 -1
  8. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/setup.py +2 -1
  9. boneio-0.1.0.dev11/boneio/version.py +0 -2
  10. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/MANIFEST.in +0 -0
  11. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/README.md +0 -0
  12. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/__init__.py +0 -0
  13. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/bonecli.py +0 -0
  14. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/const.py +0 -0
  15. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/fonts/danube__.ttf +0 -0
  16. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/helper/__init__.py +0 -0
  17. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/helper/gpio.py +0 -0
  18. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/helper/ha_discovery.py +0 -0
  19. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/helper/oled.py +0 -0
  20. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/helper/stats.py +0 -0
  21. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/helper/yaml.py +0 -0
  22. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/input/__init__.py +0 -0
  23. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/input/gpio.py +0 -0
  24. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/manager.py +0 -0
  25. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/mqtt_client.py +0 -0
  26. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/oled.py +0 -0
  27. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/relay/__init__.py +0 -0
  28. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/relay/basic.py +0 -0
  29. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/relay/gpio.py +0 -0
  30. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/relay/mcp.py +0 -0
  31. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio/schema.yaml +0 -0
  32. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio.egg-info/dependency_links.txt +0 -0
  33. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio.egg-info/entry_points.txt +0 -0
  34. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/boneio.egg-info/top_level.txt +0 -0
  35. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/requirements.txt +0 -0
  36. {boneio-0.1.0.dev11 → boneio-0.1.0.dev13}/setup.cfg +0 -0
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneio
3
- Version: 0.1.0.dev11
3
+ Version: 0.1.0.dev13
4
4
  Summary: Python Helper for BoneIO
5
5
  Home-page: https://github.com/maciejk1984/boneIO
6
6
  License: GNU General Public License v3.0
7
- Download-URL: https://github.com/maciejk1984/boneIO/archive/0.1.0.dev11.zip
7
+ Download-URL: https://github.com/maciejk1984/boneIO/archive/0.1.0.dev13.zip
8
8
  Platform: UNKNOWN
9
9
  Classifier: Programming Language :: Python
10
10
  Classifier: Programming Language :: Python :: 3.7
@@ -0,0 +1,4 @@
1
+ """Sensor module."""
2
+ from .lm75 import LM75
3
+
4
+ __all__ = ["LM75"]
@@ -0,0 +1,45 @@
1
+ """Manage LM75 sensor."""
2
+
3
+ import asyncio
4
+ from adafruit_pct2075 import PCT2075
5
+ from typing import Callable, Union
6
+ from ..const import STATE, SENSOR
7
+
8
+
9
+ class LM75:
10
+ """Represent LM75 sensor in BoneIO."""
11
+
12
+ def __init__(
13
+ self,
14
+ i2c,
15
+ address,
16
+ topic_prefix: str,
17
+ name: str,
18
+ send_message: Callable[[str, Union[str, dict]], None],
19
+ id: str = "lm75",
20
+ ):
21
+ """Initialize LM75 class."""
22
+ self._id = id
23
+ self._name = name
24
+ self._send_message = send_message
25
+ self._send_topic = f"{topic_prefix}/{SENSOR}/{self._id}"
26
+ self._pct = PCT2075(i2c_bus=i2c, address=address)
27
+
28
+ @property
29
+ def name(self):
30
+ """Return name of the sensor."""
31
+ return self._name
32
+
33
+ @property
34
+ def state(self):
35
+ """Give rounded value of temperature."""
36
+ return round(self._pct.temperature, 2)
37
+
38
+ async def send_state(self):
39
+ """Fetch temperature periodically and send to MQTT."""
40
+ while True:
41
+ self._send_message(
42
+ topic=self._send_topic,
43
+ payload={STATE: self.state},
44
+ )
45
+ await asyncio.sleep(60)
@@ -0,0 +1,2 @@
1
+ # flake8: noqa
2
+ __version__ = "0.1.0.dev13"
@@ -1,10 +1,10 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneio
3
- Version: 0.1.0.dev11
3
+ Version: 0.1.0.dev13
4
4
  Summary: Python Helper for BoneIO
5
5
  Home-page: https://github.com/maciejk1984/boneIO
6
6
  License: GNU General Public License v3.0
7
- Download-URL: https://github.com/maciejk1984/boneIO/archive/0.1.0.dev11.zip
7
+ Download-URL: https://github.com/maciejk1984/boneIO/archive/0.1.0.dev13.zip
8
8
  Platform: UNKNOWN
9
9
  Classifier: Programming Language :: Python
10
10
  Classifier: Programming Language :: Python :: 3.7
@@ -28,4 +28,6 @@ boneio/input/gpio.py
28
28
  boneio/relay/__init__.py
29
29
  boneio/relay/basic.py
30
30
  boneio/relay/gpio.py
31
- boneio/relay/mcp.py
31
+ boneio/relay/mcp.py
32
+ boneio/sensor/__init__.py
33
+ boneio/sensor/lm75.py
@@ -1,7 +1,8 @@
1
1
  Adafruit-BBIO==1.2.0
2
2
  Adafruit-Blinka==6.15.0
3
3
  adafruit-circuitpython-mcp230xx==2.5.1
4
- adafruit-circuitpython-pct2075==1.1.11Adafruit-PlatformDetect==3.17.2
4
+ adafruit-circuitpython-pct2075==1.1.11
5
+ Adafruit-PlatformDetect==3.17.2
5
6
  Adafruit-PureIO==1.1.9
6
7
  asyncio-mqtt==0.10.0
7
8
  Cerberus==1.3.4
@@ -32,7 +32,8 @@ setup(
32
32
  "Adafruit-BBIO==1.2.0",
33
33
  "Adafruit-Blinka==6.15.0",
34
34
  "adafruit-circuitpython-mcp230xx==2.5.1",
35
- "adafruit-circuitpython-pct2075==1.1.11" "Adafruit-PlatformDetect==3.17.2",
35
+ "adafruit-circuitpython-pct2075==1.1.11",
36
+ "Adafruit-PlatformDetect==3.17.2",
36
37
  "Adafruit-PureIO==1.1.9",
37
38
  "asyncio-mqtt==0.10.0",
38
39
  "Cerberus==1.3.4",
@@ -1,2 +0,0 @@
1
- # flake8: noqa
2
- __version__ = "0.1.0.dev11"
File without changes
File without changes
File without changes