boneIO 0.7.2.dev3__tar.gz → 0.7.2.dev4__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 (92) hide show
  1. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/PKG-INFO +1 -1
  2. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/modbus.py +24 -1
  3. boneIO-0.7.2.dev4/boneio/version.py +2 -0
  4. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/pyproject.toml +1 -1
  5. boneIO-0.7.2.dev3/boneio/version.py +0 -2
  6. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/LICENSE +0 -0
  7. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/README.md +0 -0
  8. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/__init__.py +0 -0
  9. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/bonecli.py +0 -0
  10. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/const.py +0 -0
  11. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/cover.py +0 -0
  12. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/__init__.py +0 -0
  13. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/adc.yaml +0 -0
  14. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/binary_sensor.yaml +0 -0
  15. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/config.yaml +0 -0
  16. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/cover.yaml +0 -0
  17. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/event.yaml +0 -0
  18. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/event_all.yaml +0 -0
  19. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/led32x4A.yaml +0 -0
  20. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/output24x16A.yaml +0 -0
  21. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/output24x16A_v0.3.yaml +0 -0
  22. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/output32x5A.yaml +0 -0
  23. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/fonts/danube__.ttf +0 -0
  24. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/group/__init__.py +0 -0
  25. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/group/output.py +0 -0
  26. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/__init__.py +0 -0
  27. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/async_updater.py +0 -0
  28. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/click_timer.py +0 -0
  29. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/config.py +0 -0
  30. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/events.py +0 -0
  31. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/exceptions.py +0 -0
  32. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/filter.py +0 -0
  33. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/gpio.py +0 -0
  34. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/ha_discovery.py +0 -0
  35. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/loader.py +0 -0
  36. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/logger.py +0 -0
  37. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/mqtt.py +0 -0
  38. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/oled.py +0 -0
  39. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/W1ThermSensor.py +0 -0
  40. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/__init__.py +0 -0
  41. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/ds2482.py +0 -0
  42. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/onewire.py +0 -0
  43. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/pcf8575.py +0 -0
  44. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/queue.py +0 -0
  45. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/sensor/ina_219_smbus.py +0 -0
  46. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/state_manager.py +0 -0
  47. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/stats.py +0 -0
  48. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/timeperiod.py +0 -0
  49. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/util.py +0 -0
  50. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/yaml_util.py +0 -0
  51. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/input/__init__.py +0 -0
  52. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/input/gpio.py +0 -0
  53. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/input/gpio_new.py +0 -0
  54. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/manager.py +0 -0
  55. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/mqtt_client.py +0 -0
  56. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/oled.py +0 -0
  57. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/__init__.py +0 -0
  58. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/basic.py +0 -0
  59. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/gpio.py +0 -0
  60. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/mcp.py +0 -0
  61. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/pca.py +0 -0
  62. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/pcf.py +0 -0
  63. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/runner.py +0 -0
  64. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/actions.yaml +0 -0
  65. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/actions_sensor.yaml +0 -0
  66. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/actions_switch.yaml +0 -0
  67. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/filters.yaml +0 -0
  68. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/filters_adc.yaml +0 -0
  69. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/id.yaml +0 -0
  70. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/schema.yaml +0 -0
  71. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/temp_unit.yaml +0 -0
  72. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/update_interval.yaml +0 -0
  73. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/__init__.py +0 -0
  74. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/adc.py +0 -0
  75. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/gpio.py +0 -0
  76. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/gpio_new.py +0 -0
  77. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/ina219.py +0 -0
  78. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/__init__.py +0 -0
  79. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/dts1964_3f.json +0 -0
  80. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/pt100.json +0 -0
  81. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/r4dcb08.json +0 -0
  82. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/sdm120.json +0 -0
  83. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/sdm630.json +0 -0
  84. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/socomec_e23.json +0 -0
  85. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/sofar.json +0 -0
  86. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/__init__.py +0 -0
  87. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/dallas.py +0 -0
  88. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/lm75.py +0 -0
  89. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/mcp9808.py +0 -0
  90. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/tests/32_5_config.yaml +0 -0
  91. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/tests/bandit.yaml +0 -0
  92. {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/tests/relay_32_5.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: boneIO
3
- Version: 0.7.2.dev3
3
+ Version: 0.7.2.dev4
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>
@@ -93,10 +93,33 @@ class Modbus:
93
93
  _LOGGER.error(exception_error)
94
94
  return False
95
95
 
96
+ async def read_single_register(
97
+ self, unit: int, address: int, count: int = 2, method: str = "input"
98
+ ) -> float | None:
99
+ """Call sync. pymodbus."""
100
+ async with self._lock:
101
+ if not self._pymodbus_connect():
102
+ _LOGGER.error("Can't connect to Modbus address %s.", address)
103
+ return None
104
+ kwargs = {"unit": unit, "count": count} if unit else {}
105
+ try:
106
+ result: ReadInputRegistersResponse = self._read_methods[method](
107
+ address, **kwargs
108
+ )
109
+ except ModbusException as exception_error:
110
+ _LOGGER.error(exception_error)
111
+ return None
112
+ if not hasattr(result, REGISTERS):
113
+ _LOGGER.error(str(result))
114
+ return None
115
+ return BinaryPayloadDecoder.fromRegisters(
116
+ result.registers, byteorder=Endian.Big, wordorder=Endian.Big
117
+ ).decode_32bit_float()
118
+
96
119
  async def read_multiple_registers(
97
120
  self, unit: int, address: int, count: int = 2, method: str = "input"
98
121
  ) -> ModbusResponse:
99
- """Read single or multiple register(s)."""
122
+ """Call sync. pymodbus."""
100
123
  async with self._lock:
101
124
  if not self._pymodbus_connect():
102
125
  _LOGGER.error("Can't connect to Modbus.")
@@ -0,0 +1,2 @@
1
+ # flake8: noqa
2
+ __version__ = "0.7.2dev4"
@@ -30,7 +30,7 @@ dependencies = [
30
30
  "Adafruit-BBIO>=1.2.0",
31
31
  ]
32
32
  requires-python = ">=3.7"
33
- version = "0.7.2.dev3"
33
+ version = "0.7.2.dev4"
34
34
 
35
35
  [project.license]
36
36
  text = "GNU General Public License v3.0"
@@ -1,2 +0,0 @@
1
- # flake8: noqa
2
- __version__ = "0.7.2dev3"
File without changes
File without changes
File without changes
File without changes
File without changes