boneIO 0.1.0.dev13__tar.gz → 0.1.0.dev14__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.dev13 → boneio-0.1.0.dev14}/PKG-INFO +2 -2
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/bonecli.py +10 -9
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/const.py +1 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/helper/__init__.py +9 -5
- boneio-0.1.0.dev14/boneio/helper/exceptions.py +13 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/helper/gpio.py +11 -3
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/helper/ha_discovery.py +2 -2
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/helper/oled.py +1 -1
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/helper/stats.py +3 -4
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/helper/yaml.py +1 -1
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/input/__init__.py +1 -1
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/input/gpio.py +3 -2
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/manager.py +69 -50
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/mqtt_client.py +1 -1
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/oled.py +3 -3
- boneio-0.1.0.dev14/boneio/relay/__init__.py +5 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/relay/basic.py +1 -1
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/relay/gpio.py +2 -2
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/relay/mcp.py +1 -1
- boneio-0.1.0.dev14/boneio/sensor/__init__.py +4 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/sensor/lm75.py +9 -4
- boneio-0.1.0.dev14/boneio/version.py +2 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio.egg-info/PKG-INFO +2 -2
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio.egg-info/SOURCES.txt +1 -0
- boneio-0.1.0.dev13/boneio/relay/__init__.py +0 -5
- boneio-0.1.0.dev13/boneio/sensor/__init__.py +0 -4
- boneio-0.1.0.dev13/boneio/version.py +0 -2
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/MANIFEST.in +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/README.md +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/__init__.py +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/fonts/danube__.ttf +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio/schema.yaml +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio.egg-info/dependency_links.txt +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio.egg-info/entry_points.txt +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio.egg-info/requires.txt +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/boneio.egg-info/top_level.txt +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/requirements.txt +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/setup.cfg +0 -0
- {boneio-0.1.0.dev13 → boneio-0.1.0.dev14}/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.dev14
|
|
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.dev14.zip
|
|
8
8
|
Platform: UNKNOWN
|
|
9
9
|
Classifier: Programming Language :: Python
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.7
|
|
@@ -6,7 +6,7 @@ from functools import wraps
|
|
|
6
6
|
import click
|
|
7
7
|
from colorlog import ColoredFormatter
|
|
8
8
|
|
|
9
|
-
from .const import (
|
|
9
|
+
from boneio.const import (
|
|
10
10
|
ENABLED,
|
|
11
11
|
GPIO_INPUT,
|
|
12
12
|
HA_DISCOVERY,
|
|
@@ -19,11 +19,12 @@ from .const import (
|
|
|
19
19
|
PASSWORD,
|
|
20
20
|
TOPIC_PREFIX,
|
|
21
21
|
USERNAME,
|
|
22
|
+
LM75,
|
|
22
23
|
)
|
|
23
|
-
from .helper import CustomValidator, load_yaml_file
|
|
24
|
-
from .manager import Manager
|
|
25
|
-
from .mqtt_client import MQTTClient
|
|
26
|
-
from .version import __version__
|
|
24
|
+
from boneio.helper import CustomValidator, load_yaml_file
|
|
25
|
+
from boneio.manager import Manager
|
|
26
|
+
from boneio.mqtt_client import MQTTClient
|
|
27
|
+
from boneio.version import __version__
|
|
27
28
|
|
|
28
29
|
_LOGGER = logging.getLogger(__name__)
|
|
29
30
|
logging.basicConfig(level=logging.INFO)
|
|
@@ -133,12 +134,12 @@ async def run(ctx, debug: int, config: str, mqttpassword: str = ""):
|
|
|
133
134
|
manager = Manager(
|
|
134
135
|
send_message=client.send_message,
|
|
135
136
|
topic_prefix=_config[MQTT][TOPIC_PREFIX],
|
|
136
|
-
relay_pins=_config[
|
|
137
|
-
input_pins=_config[
|
|
137
|
+
relay_pins=_config.get(OUTPUT, []),
|
|
138
|
+
input_pins=_config.get(GPIO_INPUT, []),
|
|
138
139
|
ha_discovery=_config[MQTT][HA_DISCOVERY][ENABLED],
|
|
139
140
|
ha_discovery_prefix=_config[MQTT][HA_DISCOVERY][TOPIC_PREFIX],
|
|
140
|
-
mcp23017=_config[
|
|
141
|
-
lm75=_config.get(
|
|
141
|
+
mcp23017=_config.get(MCP23017, []),
|
|
142
|
+
lm75=_config.get(LM75),
|
|
142
143
|
oled=_config.get(OLED),
|
|
143
144
|
)
|
|
144
145
|
tasks = set()
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"""Helper dir for BoneIO."""
|
|
2
|
-
from .gpio import edge_detect, setup_input
|
|
3
|
-
from .oled import make_font
|
|
4
|
-
from .stats import HostData, host_stats
|
|
5
|
-
from .yaml import CustomValidator, load_yaml_file
|
|
6
|
-
from .ha_discovery import (
|
|
2
|
+
from boneio.helper.gpio import edge_detect, setup_input, read_input
|
|
3
|
+
from boneio.helper.oled import make_font
|
|
4
|
+
from boneio.helper.stats import HostData, host_stats
|
|
5
|
+
from boneio.helper.yaml import CustomValidator, load_yaml_file
|
|
6
|
+
from boneio.helper.ha_discovery import (
|
|
7
7
|
ha_relay_availibilty_message,
|
|
8
8
|
ha_sensor_availibilty_message,
|
|
9
9
|
ha_sensor_temp_availibilty_message,
|
|
10
10
|
)
|
|
11
|
+
from boneio.helper.exceptions import GPIOInputException, I2CError
|
|
11
12
|
|
|
12
13
|
__all__ = [
|
|
13
14
|
"CustomValidator",
|
|
@@ -16,8 +17,11 @@ __all__ = [
|
|
|
16
17
|
"host_stats",
|
|
17
18
|
"setup_input",
|
|
18
19
|
"edge_detect",
|
|
20
|
+
"read_input",
|
|
19
21
|
"make_font",
|
|
20
22
|
"ha_relay_availibilty_message",
|
|
21
23
|
"ha_sensor_availibilty_message",
|
|
22
24
|
"ha_sensor_temp_availibilty_message",
|
|
25
|
+
"GPIOInputException",
|
|
26
|
+
"I2CError",
|
|
23
27
|
]
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import logging
|
|
1
2
|
from Adafruit_BBIO import GPIO
|
|
2
3
|
from Adafruit_BBIO.GPIO import HIGH, LOW
|
|
3
4
|
|
|
5
|
+
from boneio.helper.exceptions import GPIOInputException
|
|
6
|
+
|
|
4
7
|
|
|
5
8
|
def setup_output(pin: str):
|
|
6
9
|
"""Set up a GPIO as output."""
|
|
@@ -10,7 +13,10 @@ def setup_output(pin: str):
|
|
|
10
13
|
|
|
11
14
|
def setup_input(pin: str, pull_mode: str = "UP"):
|
|
12
15
|
"""Set up a GPIO as input."""
|
|
13
|
-
|
|
16
|
+
try:
|
|
17
|
+
GPIO.setup(pin, GPIO.IN, GPIO.PUD_DOWN if pull_mode == "DOWN" else GPIO.PUD_UP)
|
|
18
|
+
except (ValueError, SystemError) as err:
|
|
19
|
+
raise GPIOInputException(err)
|
|
14
20
|
|
|
15
21
|
|
|
16
22
|
def write_output(pin: str, value: str):
|
|
@@ -26,5 +32,7 @@ def read_input(pin: str, on_state=LOW):
|
|
|
26
32
|
|
|
27
33
|
def edge_detect(pin, callback, bounce):
|
|
28
34
|
"""Add detection for RISING and FALLING events."""
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
try:
|
|
36
|
+
GPIO.add_event_detect(pin, GPIO.FALLING, callback=callback, bouncetime=bounce)
|
|
37
|
+
except RuntimeError as err:
|
|
38
|
+
raise GPIOInputException(err)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
from
|
|
1
|
+
from boneio.version import __version__
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
from
|
|
4
|
+
from boneio.const import INPUT, OFF, ON, RELAY, STATE, SENSOR
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
def ha_relay_availibilty_message(id: str, name: str, topic: str = "boneio"):
|
|
@@ -7,7 +7,7 @@ from typing import Callable
|
|
|
7
7
|
|
|
8
8
|
import psutil
|
|
9
9
|
|
|
10
|
-
from
|
|
10
|
+
from boneio.const import (
|
|
11
11
|
CPU,
|
|
12
12
|
DISK,
|
|
13
13
|
GIGABYTE,
|
|
@@ -16,10 +16,9 @@ from ..const import (
|
|
|
16
16
|
MEMORY,
|
|
17
17
|
NETWORK,
|
|
18
18
|
SWAP,
|
|
19
|
-
TEMPERATURE,
|
|
20
19
|
UPTIME,
|
|
21
20
|
)
|
|
22
|
-
from
|
|
21
|
+
from boneio.sensor import LM75Sensor
|
|
23
22
|
|
|
24
23
|
intervals = (("d", 86400), ("h", 3600), ("m", 60))
|
|
25
24
|
|
|
@@ -132,7 +131,7 @@ class HostData:
|
|
|
132
131
|
|
|
133
132
|
data = {UPTIME: {}, NETWORK: {}, CPU: {}, DISK: {}, MEMORY: {}, SWAP: {}}
|
|
134
133
|
|
|
135
|
-
def __init__(self, output: dict, callback: Callable, lm75:
|
|
134
|
+
def __init__(self, output: dict, callback: Callable, lm75: LM75Sensor) -> None:
|
|
136
135
|
"""Initialize HostData."""
|
|
137
136
|
self._hostname = socket.gethostname()
|
|
138
137
|
self.data[UPTIME] = {HOST: self._hostname, UPTIME: 0}
|
|
@@ -6,7 +6,7 @@ from datetime import datetime
|
|
|
6
6
|
from functools import partial
|
|
7
7
|
from typing import Callable
|
|
8
8
|
|
|
9
|
-
from
|
|
9
|
+
from boneio.const import (
|
|
10
10
|
CONFIG_PIN,
|
|
11
11
|
DEBOUNCE_DURATION,
|
|
12
12
|
DELAY_DURATION,
|
|
@@ -18,7 +18,7 @@ from ..const import (
|
|
|
18
18
|
SINGLE,
|
|
19
19
|
ClickTypes,
|
|
20
20
|
)
|
|
21
|
-
from
|
|
21
|
+
from boneio.helper import edge_detect, read_input, setup_input
|
|
22
22
|
|
|
23
23
|
_LOGGER = logging.getLogger(__name__)
|
|
24
24
|
|
|
@@ -30,6 +30,7 @@ def configure_pin(pin: str) -> None:
|
|
|
30
30
|
[CONFIG_PIN, pin, GPIO],
|
|
31
31
|
stdout=subprocess.DEVNULL,
|
|
32
32
|
stderr=subprocess.STDOUT,
|
|
33
|
+
timeout=1,
|
|
33
34
|
)
|
|
34
35
|
|
|
35
36
|
|
|
@@ -7,7 +7,7 @@ from adafruit_mcp230xx.mcp23017 import MCP23017
|
|
|
7
7
|
from board import SCL, SDA
|
|
8
8
|
from busio import I2C
|
|
9
9
|
|
|
10
|
-
from .const import (
|
|
10
|
+
from boneio.const import (
|
|
11
11
|
ACTION,
|
|
12
12
|
ACTIONS,
|
|
13
13
|
ADDRESS,
|
|
@@ -29,16 +29,18 @@ from .const import (
|
|
|
29
29
|
STATE,
|
|
30
30
|
ClickTypes,
|
|
31
31
|
)
|
|
32
|
-
from .helper import (
|
|
32
|
+
from boneio.helper import (
|
|
33
33
|
HostData,
|
|
34
34
|
ha_relay_availibilty_message,
|
|
35
35
|
ha_sensor_availibilty_message,
|
|
36
36
|
ha_sensor_temp_availibilty_message,
|
|
37
37
|
host_stats,
|
|
38
|
+
GPIOInputException,
|
|
39
|
+
I2CError,
|
|
38
40
|
)
|
|
39
|
-
from .input import GpioInputButton
|
|
40
|
-
from .oled import Oled
|
|
41
|
-
from .relay import GpioRelay, MCPRelay
|
|
41
|
+
from boneio.input import GpioInputButton
|
|
42
|
+
from boneio.oled import Oled
|
|
43
|
+
from boneio.relay import GpioRelay, MCPRelay
|
|
42
44
|
|
|
43
45
|
_LOGGER = logging.getLogger(__name__)
|
|
44
46
|
|
|
@@ -76,38 +78,46 @@ class Manager:
|
|
|
76
78
|
|
|
77
79
|
def create_lm75_sensor():
|
|
78
80
|
"""Create LM sensor in manager."""
|
|
79
|
-
from .sensor.lm75 import
|
|
81
|
+
from .sensor.lm75 import LM75Sensor
|
|
80
82
|
|
|
81
83
|
name = lm75.get(ID)
|
|
82
84
|
id = name.replace(" ", "")
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
85
|
+
try:
|
|
86
|
+
self._lm75 = LM75Sensor(
|
|
87
|
+
id=id,
|
|
88
|
+
name=name,
|
|
89
|
+
i2c=self._i2cbusio,
|
|
90
|
+
address=lm75[ADDRESS],
|
|
91
|
+
send_message=self.send_message,
|
|
92
|
+
topic_prefix=topic_prefix,
|
|
93
|
+
)
|
|
94
|
+
self.send_ha_autodiscovery(
|
|
95
|
+
id=id,
|
|
96
|
+
name=name,
|
|
97
|
+
ha_type="sensor",
|
|
98
|
+
prefix=ha_discovery_prefix,
|
|
99
|
+
availibilty_msg_func=ha_sensor_temp_availibilty_message,
|
|
100
|
+
)
|
|
101
|
+
self._tasks.append(asyncio.create_task(self._lm75.send_state()))
|
|
102
|
+
except I2CError as err:
|
|
103
|
+
_LOGGER.error("Can't configure LM75 sensor. %s", err)
|
|
104
|
+
pass
|
|
99
105
|
|
|
100
106
|
def create_mcp23017():
|
|
101
107
|
"""Create MCP23017."""
|
|
102
108
|
for mcp in mcp23017:
|
|
103
109
|
id = mcp[ID] or mcp[ADDRESS]
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
110
|
+
try:
|
|
111
|
+
self._mcp[id] = MCP23017(i2c=self._i2cbusio, address=mcp[ADDRESS])
|
|
112
|
+
sleep_time = mcp.get(INIT_SLEEP, 0)
|
|
113
|
+
_LOGGER.debug(
|
|
114
|
+
f"Sleeping for {sleep_time}s while MCP {id} is initializing."
|
|
115
|
+
)
|
|
116
|
+
time.sleep(sleep_time)
|
|
117
|
+
self._grouped_outputs[id] = {}
|
|
118
|
+
except TimeoutError as err:
|
|
119
|
+
_LOGGER.error("Can't connect to MCP %s. %s", id, err)
|
|
120
|
+
pass
|
|
111
121
|
|
|
112
122
|
if lm75:
|
|
113
123
|
create_lm75_sensor()
|
|
@@ -168,22 +178,28 @@ class Manager:
|
|
|
168
178
|
)
|
|
169
179
|
|
|
170
180
|
def configure_button(gpio):
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
181
|
+
try:
|
|
182
|
+
pin = gpio[PIN]
|
|
183
|
+
GpioInputButton(
|
|
184
|
+
pin=pin,
|
|
185
|
+
press_callback=lambda x, i: self.press_callback(
|
|
186
|
+
x, i, gpio.get(ACTIONS, {})
|
|
187
|
+
),
|
|
188
|
+
rest_pin=gpio,
|
|
189
|
+
)
|
|
190
|
+
self.send_ha_autodiscovery(
|
|
191
|
+
id=pin,
|
|
192
|
+
name=gpio.get(ID, pin),
|
|
193
|
+
ha_type="sensor",
|
|
194
|
+
prefix=ha_discovery_prefix,
|
|
195
|
+
availibilty_msg_func=ha_sensor_availibilty_message,
|
|
196
|
+
)
|
|
197
|
+
except GPIOInputException as err:
|
|
198
|
+
_LOGGER.error("This PIN %s can't be configured. %s", pin, err)
|
|
199
|
+
pass
|
|
185
200
|
|
|
186
|
-
|
|
201
|
+
for gpio in self._input_pins:
|
|
202
|
+
configure_button(gpio=gpio)
|
|
187
203
|
|
|
188
204
|
if oled:
|
|
189
205
|
self._host_data = HostData(
|
|
@@ -194,9 +210,12 @@ class Manager:
|
|
|
194
210
|
for f in host_stats.values():
|
|
195
211
|
self._tasks.append(asyncio.create_task(f(self._host_data)))
|
|
196
212
|
_LOGGER.debug("Gathering host data enabled.")
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
213
|
+
try:
|
|
214
|
+
self._oled = Oled(
|
|
215
|
+
host_data=self._host_data, output_groups=list(self._grouped_outputs)
|
|
216
|
+
)
|
|
217
|
+
except GPIOInputException as err:
|
|
218
|
+
_LOGGER.error("Can't configure OLED display. %s", err)
|
|
200
219
|
|
|
201
220
|
self.send_message(topic=f"{topic_prefix}/{STATE}", payload=ONLINE)
|
|
202
221
|
_LOGGER.info("BoneIO manager is ready.")
|
|
@@ -217,9 +236,9 @@ class Manager:
|
|
|
217
236
|
if action:
|
|
218
237
|
if action[ACTION] == OUTPUT:
|
|
219
238
|
"""For now only output type is supported"""
|
|
220
|
-
|
|
221
|
-
if
|
|
222
|
-
|
|
239
|
+
relay = self.output.get(action[PIN].replace(" ", ""))
|
|
240
|
+
if relay:
|
|
241
|
+
relay.toggle()
|
|
223
242
|
# This is similar how Z2M is clearing click sensor.
|
|
224
243
|
# self._loop.call_later(1, self.send_message, topic, "")
|
|
225
244
|
|
|
@@ -7,9 +7,9 @@ from luma.core.render import canvas
|
|
|
7
7
|
from luma.oled.device import sh1106
|
|
8
8
|
from PIL import ImageDraw
|
|
9
9
|
|
|
10
|
-
from .const import CPU, DISK, MEMORY, NETWORK, OLED_PIN, SWAP, UPTIME, WHITE
|
|
11
|
-
from .helper import HostData, edge_detect, make_font, setup_input
|
|
12
|
-
from .input import configure_pin
|
|
10
|
+
from boneio.const import CPU, DISK, MEMORY, NETWORK, OLED_PIN, SWAP, UPTIME, WHITE
|
|
11
|
+
from boneio.helper import HostData, edge_detect, make_font, setup_input
|
|
12
|
+
from boneio.input import configure_pin
|
|
13
13
|
|
|
14
14
|
_LOGGER = logging.getLogger(__name__)
|
|
15
15
|
|
|
@@ -5,8 +5,8 @@ Created just in case.
|
|
|
5
5
|
|
|
6
6
|
import logging
|
|
7
7
|
|
|
8
|
-
from
|
|
9
|
-
from .basic import BasicRelay
|
|
8
|
+
from boneio.helper.gpio import HIGH, LOW, read_input, setup_output, write_output
|
|
9
|
+
from boneio.relay.basic import BasicRelay
|
|
10
10
|
|
|
11
11
|
_LOGGER = logging.getLogger(__name__)
|
|
12
12
|
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
import asyncio
|
|
4
4
|
from adafruit_pct2075 import PCT2075
|
|
5
5
|
from typing import Callable, Union
|
|
6
|
-
from
|
|
6
|
+
from boneio.const import STATE, SENSOR, LM75
|
|
7
7
|
|
|
8
|
+
from boneio.helper.exceptions import I2CError
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
|
|
11
|
+
class LM75Sensor:
|
|
10
12
|
"""Represent LM75 sensor in BoneIO."""
|
|
11
13
|
|
|
12
14
|
def __init__(
|
|
@@ -16,14 +18,17 @@ class LM75:
|
|
|
16
18
|
topic_prefix: str,
|
|
17
19
|
name: str,
|
|
18
20
|
send_message: Callable[[str, Union[str, dict]], None],
|
|
19
|
-
id: str =
|
|
21
|
+
id: str = LM75,
|
|
20
22
|
):
|
|
21
23
|
"""Initialize LM75 class."""
|
|
22
24
|
self._id = id
|
|
23
25
|
self._name = name
|
|
24
26
|
self._send_message = send_message
|
|
25
27
|
self._send_topic = f"{topic_prefix}/{SENSOR}/{self._id}"
|
|
26
|
-
|
|
28
|
+
try:
|
|
29
|
+
self._pct = PCT2075(i2c_bus=i2c, address=address)
|
|
30
|
+
except ValueError as err:
|
|
31
|
+
raise I2CError(err)
|
|
27
32
|
|
|
28
33
|
@property
|
|
29
34
|
def name(self):
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: boneio
|
|
3
|
-
Version: 0.1.0.
|
|
3
|
+
Version: 0.1.0.dev14
|
|
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.dev14.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
|