boneIO 0.3.0.dev7__tar.gz → 0.3.0.dev8__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 (72) hide show
  1. {boneio-0.3.0.dev7/boneio.egg-info → boneio-0.3.0.dev8}/PKG-INFO +2 -2
  2. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/const.py +4 -0
  3. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/exceptions.py +4 -0
  4. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/loader.py +0 -1
  5. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/manager.py +9 -1
  6. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/modbus.py +7 -2
  7. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/schema/schema.yaml +1 -0
  8. boneio-0.3.0.dev8/boneio/version.py +2 -0
  9. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8/boneio.egg-info}/PKG-INFO +2 -2
  10. boneio-0.3.0.dev7/boneio/version.py +0 -2
  11. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/LICENSE +0 -0
  12. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/MANIFEST.in +0 -0
  13. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/README.md +0 -0
  14. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/__init__.py +0 -0
  15. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/bonecli.py +0 -0
  16. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/cover.py +0 -0
  17. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/example_config/__init__.py +0 -0
  18. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/example_config/adc.yaml +0 -0
  19. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/example_config/config.yaml +0 -0
  20. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/example_config/cover.yaml +0 -0
  21. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/example_config/input.yaml +0 -0
  22. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/example_config/output24x16A.yaml +0 -0
  23. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/example_config/output32x5A.yaml +0 -0
  24. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/fonts/danube__.ttf +0 -0
  25. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/__init__.py +0 -0
  26. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/config.py +0 -0
  27. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/ds2482/__init__.py +0 -0
  28. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/ds2482/ds2482.py +0 -0
  29. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/ds2482/onewire.py +0 -0
  30. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/events.py +0 -0
  31. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/gpio.py +0 -0
  32. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/ha_discovery.py +0 -0
  33. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/logger.py +0 -0
  34. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/mqtt.py +0 -0
  35. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/oled.py +0 -0
  36. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/queue.py +0 -0
  37. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/state_manager.py +0 -0
  38. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/stats.py +0 -0
  39. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/timeperiod.py +0 -0
  40. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/util.py +0 -0
  41. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/helper/yaml_util.py +0 -0
  42. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/input/__init__.py +0 -0
  43. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/input/gpio.py +0 -0
  44. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/mqtt_client.py +0 -0
  45. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/oled.py +0 -0
  46. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/relay/__init__.py +0 -0
  47. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/relay/basic.py +0 -0
  48. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/relay/gpio.py +0 -0
  49. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/relay/mcp.py +0 -0
  50. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/runner.py +0 -0
  51. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/schema/actions.yaml +0 -0
  52. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/schema/actions_sensor.yaml +0 -0
  53. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/schema/actions_switch.yaml +0 -0
  54. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/__init__.py +0 -0
  55. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/adc.py +0 -0
  56. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/gpio.py +0 -0
  57. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/modbus/__init__.py +0 -0
  58. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/modbus/sdm120.json +0 -0
  59. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/modbus/sdm630.json +0 -0
  60. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/modbus/sofar.json +0 -0
  61. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/temp/__init__.py +0 -0
  62. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/temp/dallas.py +0 -0
  63. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/temp/lm75.py +0 -0
  64. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio/sensor/temp/mcp9808.py +0 -0
  65. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio.egg-info/SOURCES.txt +0 -0
  66. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio.egg-info/dependency_links.txt +0 -0
  67. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio.egg-info/entry_points.txt +0 -0
  68. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio.egg-info/requires.txt +0 -0
  69. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/boneio.egg-info/top_level.txt +0 -0
  70. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/requirements.txt +0 -0
  71. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/setup.cfg +0 -0
  72. {boneio-0.3.0.dev7 → boneio-0.3.0.dev8}/setup.py +0 -0
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneio
3
- Version: 0.3.0.dev7
3
+ Version: 0.3.0.dev8
4
4
  Summary: Python App for BoneIO
5
5
  Home-page: https://github.com/boneIO-eu/app_bbb
6
- Download-URL: https://github.com/boneIO-eu/app_bbb/archive/0.3.0.dev7.zip
6
+ Download-URL: https://github.com/boneIO-eu/app_bbb/archive/0.3.0.dev8.zip
7
7
  License: GNU General Public License v3.0
8
8
  Platform: UNKNOWN
9
9
  Classifier: Programming Language :: Python
@@ -48,9 +48,13 @@ RESTORE_STATE = "restore_state"
48
48
  MODEL = "model"
49
49
  UARTS = {
50
50
  "uart1": {ID: "/dev/ttyS1", TX: "P9.24", RX: "P9.26"},
51
+ "uart2": {ID: "/dev/ttyS2", TX: "P9.21", RX: "P9.22"},
52
+ "uart3": {ID: "/dev/ttyS3", TX: "P9.42", RX: None},
51
53
  "uart4": {ID: "/dev/ttyS4", TX: "P9.13", RX: "P9.11"},
54
+ "uart5": {ID: "/dev/ttyS5", TX: "P8.37", RX: "P8.38"},
52
55
  }
53
56
 
57
+
54
58
  # HA CONSTS
55
59
  HOMEASSISTANT = "homeassistant"
56
60
  HA_DISCOVERY = "ha_discovery"
@@ -23,3 +23,7 @@ class ConfigurationException(BoneIOException):
23
23
 
24
24
  class CoverRelayException(BoneIOException):
25
25
  """Cover configuration exception."""
26
+
27
+
28
+ class ModbusUartException(BoneIOException):
29
+ """Cover configuration exception."""
@@ -127,7 +127,6 @@ def create_temp_sensor(
127
127
  ha_type=SENSOR,
128
128
  availability_msg_func=ha_sensor_temp_availabilty_message,
129
129
  )
130
- manager.append_task(asyncio.create_task(temp_sensor.send_state()))
131
130
  return temp_sensor
132
131
  except I2CError as err:
133
132
  _LOGGER.error("Can't configure Temp sensor. %s", err)
@@ -46,6 +46,7 @@ from boneio.helper import (
46
46
 
47
47
  from boneio.helper.config import ConfigHelper
48
48
  from boneio.helper.events import EventBus
49
+ from boneio.helper.exceptions import ModbusUartException
49
50
  from boneio.helper.loader import (
50
51
  configure_cover,
51
52
  configure_input,
@@ -107,7 +108,14 @@ class Manager:
107
108
  self._temp_sensors = []
108
109
  self._modbus = None
109
110
  if modbus and modbus.get(UART) in UARTS:
110
- self._modbus = Modbus(UARTS[modbus.get(UART)])
111
+ try:
112
+ self._modbus = Modbus(UARTS[modbus.get(UART)])
113
+ except ModbusUartException:
114
+ _LOGGER.error(
115
+ "This UART %s can't be used for modbus communication.",
116
+ modbus.get(UART),
117
+ )
118
+ self._modbus = None
111
119
 
112
120
  for sensor_type in (LM75, MCP_TEMP_9808):
113
121
  if sensors.get(sensor_type):
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import asyncio
4
4
  import logging
5
5
  from boneio.helper import configure_pin
6
+ from boneio.helper.exceptions import ModbusUartException
6
7
  from boneio.const import ID, RX, TX, UART, REGISTERS
7
8
  from pymodbus.client.sync import (
8
9
  BaseModbusClient,
@@ -23,9 +24,13 @@ class Modbus:
23
24
 
24
25
  def __init__(self, uart: dict[str, Any]) -> None:
25
26
  """Initialize the Modbus hub."""
27
+ rx = uart.get(RX)
28
+ tx = uart.get(TX)
29
+ if not tx or not rx:
30
+ raise ModbusUartException
26
31
 
27
- configure_pin(pin=uart[RX], mode=UART)
28
- configure_pin(pin=uart[TX], mode=UART)
32
+ configure_pin(pin=rx, mode=UART)
33
+ configure_pin(pin=tx, mode=UART)
29
34
  self._uart = uart
30
35
 
31
36
  # generic configuration
@@ -93,6 +93,7 @@ modbus:
93
93
  uart:
94
94
  type: string
95
95
  required: True
96
+ allowed: ["uart1", "uart2", "uart3", "uart4", "uart5"]
96
97
  meta:
97
98
  label: Uart ID to use
98
99
 
@@ -0,0 +1,2 @@
1
+ # flake8: noqa
2
+ __version__ = "0.3.0.dev8"
@@ -1,9 +1,9 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneio
3
- Version: 0.3.0.dev7
3
+ Version: 0.3.0.dev8
4
4
  Summary: Python App for BoneIO
5
5
  Home-page: https://github.com/boneIO-eu/app_bbb
6
- Download-URL: https://github.com/boneIO-eu/app_bbb/archive/0.3.0.dev7.zip
6
+ Download-URL: https://github.com/boneIO-eu/app_bbb/archive/0.3.0.dev8.zip
7
7
  License: GNU General Public License v3.0
8
8
  Platform: UNKNOWN
9
9
  Classifier: Programming Language :: Python
@@ -1,2 +0,0 @@
1
- # flake8: noqa
2
- __version__ = "0.3.0.dev7"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes