boneIO 0.1.0.dev12__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.
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/PKG-INFO +2 -2
- boneio-0.1.0.dev13/boneio/sensor/__init__.py +4 -0
- boneio-0.1.0.dev13/boneio/sensor/lm75.py +45 -0
- boneio-0.1.0.dev13/boneio/version.py +2 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio.egg-info/PKG-INFO +2 -2
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio.egg-info/SOURCES.txt +3 -1
- boneio-0.1.0.dev12/boneio/version.py +0 -2
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/MANIFEST.in +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/README.md +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/__init__.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/bonecli.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/const.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/fonts/danube__.ttf +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/helper/__init__.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/helper/gpio.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/helper/ha_discovery.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/helper/oled.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/helper/stats.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/helper/yaml.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/input/__init__.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/input/gpio.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/manager.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/mqtt_client.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/oled.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/relay/__init__.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/relay/basic.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/relay/gpio.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/relay/mcp.py +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio/schema.yaml +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio.egg-info/dependency_links.txt +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio.egg-info/entry_points.txt +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio.egg-info/requires.txt +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/boneio.egg-info/top_level.txt +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/requirements.txt +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/setup.cfg +0 -0
- {boneio-0.1.0.dev12 → boneio-0.1.0.dev13}/setup.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: boneio
|
|
3
|
-
Version: 0.1.0.
|
|
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.
|
|
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,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)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: boneio
|
|
3
|
-
Version: 0.1.0.
|
|
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.
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|