boneIO 0.5.0.dev7__tar.gz → 0.5.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 (73) hide show
  1. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/PKG-INFO +1 -1
  2. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/modbus/__init__.py +25 -27
  3. boneIO-0.5.0.dev8/boneio/sensor/modbus/pt100.json +21 -0
  4. boneIO-0.5.0.dev8/boneio/version.py +2 -0
  5. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/pyproject.toml +1 -1
  6. boneIO-0.5.0.dev7/boneio/version.py +0 -2
  7. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/LICENSE +0 -0
  8. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/README.md +0 -0
  9. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/__init__.py +0 -0
  10. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/bonecli.py +0 -0
  11. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/const.py +0 -0
  12. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/cover.py +0 -0
  13. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/example_config/__init__.py +0 -0
  14. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/example_config/adc.yaml +0 -0
  15. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/example_config/config.yaml +0 -0
  16. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/example_config/cover.yaml +0 -0
  17. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/example_config/input.yaml +0 -0
  18. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/example_config/output24x16A.yaml +0 -0
  19. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/example_config/output32x5A.yaml +0 -0
  20. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/fonts/danube__.ttf +0 -0
  21. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/__init__.py +0 -0
  22. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/async_updater.py +0 -0
  23. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/config.py +0 -0
  24. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/events.py +0 -0
  25. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/exceptions.py +0 -0
  26. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/filter.py +0 -0
  27. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/gpio.py +0 -0
  28. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/ha_discovery.py +0 -0
  29. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/loader.py +0 -0
  30. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/logger.py +0 -0
  31. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/mqtt.py +0 -0
  32. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/oled.py +0 -0
  33. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/onewire/W1ThermSensor.py +0 -0
  34. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/onewire/__init__.py +0 -0
  35. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/onewire/ds2482.py +0 -0
  36. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/onewire/onewire.py +0 -0
  37. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/queue.py +0 -0
  38. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/state_manager.py +0 -0
  39. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/stats.py +0 -0
  40. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/timeperiod.py +0 -0
  41. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/util.py +0 -0
  42. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/helper/yaml_util.py +0 -0
  43. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/input/__init__.py +0 -0
  44. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/input/gpio.py +0 -0
  45. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/manager.py +0 -0
  46. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/modbus.py +0 -0
  47. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/mqtt_client.py +0 -0
  48. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/oled.py +0 -0
  49. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/relay/__init__.py +0 -0
  50. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/relay/basic.py +0 -0
  51. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/relay/gpio.py +0 -0
  52. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/relay/mcp.py +0 -0
  53. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/runner.py +0 -0
  54. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/schema/actions.yaml +0 -0
  55. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/schema/actions_sensor.yaml +0 -0
  56. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/schema/actions_switch.yaml +0 -0
  57. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/schema/filters.yaml +0 -0
  58. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/schema/filters_adc.yaml +0 -0
  59. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/schema/schema.yaml +0 -0
  60. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/schema/update_interval.yaml +0 -0
  61. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/__init__.py +0 -0
  62. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/adc.py +0 -0
  63. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/gpio.py +0 -0
  64. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/modbus/sdm120.json +0 -0
  65. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/modbus/sdm630.json +0 -0
  66. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/modbus/sofar.json +0 -0
  67. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/temp/__init__.py +0 -0
  68. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/temp/dallas.py +0 -0
  69. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/temp/lm75.py +0 -0
  70. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/boneio/sensor/temp/mcp9808.py +0 -0
  71. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/tests/32_5_config.yaml +0 -0
  72. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/tests/bandit.yaml +0 -0
  73. {boneIO-0.5.0.dev7 → boneIO-0.5.0.dev8}/tests/relay_32_5.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneIO
3
- Version: 0.5.0dev7
3
+ Version: 0.5.0dev8
4
4
  Summary: Python App for BoneIO
5
5
  License: GNU General Public License v3.0
6
6
  Author-email: Paweł Szafer <pszafer@gmail.com>
@@ -143,33 +143,28 @@ class ModbusSensor(BasicMqtt, AsyncUpdater):
143
143
 
144
144
  def _send_discovery_for_all_registers(self, register: int = 0) -> bool:
145
145
  """Send discovery message to HA for each register."""
146
- if register > 0:
147
- for data in self._db[REGISTERS_BASE]:
148
- for register in data[REGISTERS]:
149
- value_template = (
150
- f'{{{{ value_json.{register.get("name").replace(" ", "")} | '
151
- f'{register.get("ha_filter", "round(2)")} }}}}'
152
- )
153
- kwargs = {
154
- "unit_of_measurement": register.get("unit_of_measurement"),
155
- "state_class": register.get("state_class"),
156
- "value_template": value_template,
157
- "sensor_id": register.get("name"),
158
- }
159
- device_class = register.get("device_class")
160
- if device_class:
161
- kwargs["device_class"] = device_class
162
- self._send_ha_autodiscovery(
163
- id=self._id,
164
- sdm_name=self._name,
165
- state_topic_base=data[BASE],
166
- **kwargs,
167
- )
168
- return datetime.now()
169
- _LOGGER.error(
170
- "Discovery for %s not sent. First register not available.", self._id
171
- )
172
- return False
146
+ for data in self._db[REGISTERS_BASE]:
147
+ for register in data[REGISTERS]:
148
+ value_template = (
149
+ f'{{{{ value_json.{register.get("name").replace(" ", "")} | '
150
+ f'{register.get("ha_filter", "round(2)")} }}}}'
151
+ )
152
+ kwargs = {
153
+ "unit_of_measurement": register.get("unit_of_measurement"),
154
+ "state_class": register.get("state_class"),
155
+ "value_template": value_template,
156
+ "sensor_id": register.get("name"),
157
+ }
158
+ device_class = register.get("device_class")
159
+ if device_class:
160
+ kwargs["device_class"] = device_class
161
+ self._send_ha_autodiscovery(
162
+ id=self._id,
163
+ sdm_name=self._name,
164
+ state_topic_base=data[BASE],
165
+ **kwargs,
166
+ )
167
+ return datetime.now()
173
168
 
174
169
  async def check_availability(self) -> None:
175
170
  """Get first register and check if it's available."""
@@ -193,6 +188,9 @@ class ModbusSensor(BasicMqtt, AsyncUpdater):
193
188
  )
194
189
  await asyncio.sleep(2)
195
190
  break
191
+ _LOGGER.error(
192
+ "Discovery for %s not sent. First register not available.", self._id
193
+ )
196
194
 
197
195
  async def async_update(self, time: datetime) -> None:
198
196
  """Fetch state periodically and send to MQTT."""
@@ -0,0 +1,21 @@
1
+ {
2
+ "model": "PT100",
3
+ "registers_base": [
4
+ {
5
+ "base": 1,
6
+ "length": 1,
7
+ "register_type": "holding",
8
+ "registers": [
9
+ {
10
+ "name": "Temperature1 PT100",
11
+ "address": 1,
12
+ "unit_of_measurement": "°C",
13
+ "state_class": "measurement",
14
+ "device_class": "temperature",
15
+ "return_type": "multiply0_1"
16
+ }
17
+ ]
18
+
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,2 @@
1
+ # flake8: noqa
2
+ __version__ = "0.5.0dev8"
@@ -27,7 +27,7 @@ dependencies = [
27
27
  "w1thermsensor[async]>=2.0.0",
28
28
  ]
29
29
  requires-python = ">=3.7"
30
- version = "0.5.0dev7"
30
+ version = "0.5.0dev8"
31
31
 
32
32
  [project.license]
33
33
  text = "GNU General Public License v3.0"
@@ -1,2 +0,0 @@
1
- # flake8: noqa
2
- __version__ = "0.5.0dev7"
File without changes
File without changes
File without changes
File without changes
File without changes