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.
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/PKG-INFO +1 -1
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/modbus.py +24 -1
- boneIO-0.7.2.dev4/boneio/version.py +2 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/pyproject.toml +1 -1
- boneIO-0.7.2.dev3/boneio/version.py +0 -2
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/LICENSE +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/README.md +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/bonecli.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/const.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/cover.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/adc.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/binary_sensor.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/config.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/cover.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/event.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/event_all.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/led32x4A.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/output24x16A.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/output24x16A_v0.3.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/example_config/output32x5A.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/fonts/danube__.ttf +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/group/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/group/output.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/async_updater.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/click_timer.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/config.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/events.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/exceptions.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/filter.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/gpio.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/ha_discovery.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/loader.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/logger.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/mqtt.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/oled.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/W1ThermSensor.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/ds2482.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/onewire/onewire.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/pcf8575.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/queue.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/sensor/ina_219_smbus.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/state_manager.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/stats.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/timeperiod.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/util.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/helper/yaml_util.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/input/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/input/gpio.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/input/gpio_new.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/manager.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/mqtt_client.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/oled.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/basic.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/gpio.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/mcp.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/pca.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/relay/pcf.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/runner.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/actions.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/actions_sensor.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/actions_switch.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/filters.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/filters_adc.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/id.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/schema.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/temp_unit.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/schema/update_interval.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/adc.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/gpio.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/gpio_new.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/ina219.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/dts1964_3f.json +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/pt100.json +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/r4dcb08.json +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/sdm120.json +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/sdm630.json +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/socomec_e23.json +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/modbus/sofar.json +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/__init__.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/dallas.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/lm75.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/boneio/sensor/temp/mcp9808.py +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/tests/32_5_config.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/tests/bandit.yaml +0 -0
- {boneIO-0.7.2.dev3 → boneIO-0.7.2.dev4}/tests/relay_32_5.py +0 -0
|
@@ -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
|
-
"""
|
|
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.")
|
|
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
|
|
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
|
|
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
|