Marc Mueller
141acba40d
Remove unnecessary try-else (3) ( #86160 )
2023-01-18 14:25:28 +01:00
jan iversen
05c1aff0f6
Bump pymodbus library to V3.1.0 ( #85961 )
...
fixes undefined
2023-01-15 23:30:26 +01:00
jan iversen
6bd70fdf15
Solve Modbus reload issue ( #82253 )
...
fixes undefined
2022-11-18 09:32:51 +01:00
jan iversen
1a79118600
Fix modbus reload service ( #68040 )
...
* Fix modbus reload service.
* Please coverage.
* Resolve difference between local pytest and github.
2022-03-12 14:12:38 +02:00
jan iversen
85c863a766
Allow reload of modbus ( #67390 )
...
* Allow reload of modbus.
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-03-03 08:46:58 +01:00
jan iversen
adc4c1e33f
Secure ATTR_ and CONF_ use identical texts in Modbus ( #66901 )
2022-02-25 08:05:19 -08:00
jan iversen
9131fb39fe
Allow "slave" parameter in modbus service calls ( #66874 )
...
* Allow "slave" parameter in modbus service calls.
2022-02-24 13:35:45 +01:00
Marc Mueller
c46728c2b2
Fix modbus typing ( #66872 )
2022-02-19 15:48:05 +01:00
Marc Mueller
b0f72f59da
Use imports from core
( #63458 )
2022-01-05 14:55:38 +01:00
jan iversen
f2a5d92e61
Fix connect_fail test and modbus.py 100% coverage ( #57894 )
...
Co-authored-by: Joakim Sørensen <joasoe@gmail.com>
2021-10-20 15:22:24 -07:00
jan iversen
f92fe38bbd
Change warning to info when modbus is ready ( #57953 )
...
* Change warning to info.
* Make level info implicit.
2021-10-18 19:38:33 -07:00
jan iversen
42803e6ac0
Clean startup of modbus by moving service schemas ( #57763 )
2021-10-15 09:40:27 -07:00
jan iversen
6a39119ccc
Streamline modbus before 100% coverage. ( #57478 )
2021-10-11 13:26:36 -05:00
Marc Mueller
d51487f82a
Import Callable from collections.abc (3) ( #56777 )
2021-09-29 16:19:06 +02:00
jan iversen
f3ad4ca0cc
Strictly type modbus.py. ( #56375 )
2021-09-20 18:47:05 +02:00
jan iversen
a84e86ff13
Strictly type modbus base_platform.py ( #56343 )
2021-09-20 14:59:30 +02:00
jan iversen
aaa62dadec
Add service to stop/restart modbus ( #55599 )
...
* Add service to stop/restart modbus.
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-09-14 09:42:50 +02:00
jan iversen
f91cc21bbd
Solve modbus shutdown racing condition ( #55373 )
2021-08-28 23:04:33 +02:00
jan iversen
7ac72ebf38
Add modbus name to log_error ( #55336 )
2021-08-27 09:26:57 -07:00
jan iversen
2d5176eee9
Change entity_timers to be a local variable. ( #55258 )
...
Ensure outstanding pymodbus calls are handled before closing.
2021-08-26 15:23:00 +02:00
jan iversen
d4064e7044
Cancel entity timers. ( #55141 )
2021-08-25 14:49:37 +02:00
jan iversen
bafbbc6563
Adjust modbus constants names ( #54792 )
...
* Follow up.
2021-08-18 12:56:54 +02:00
jan iversen
e8aa280d7f
Add modbus get_hub ( #54277 )
...
* Add dict with hubs.
* Update flexit to use get_hub.
* Remove executor_task for close.
2021-08-08 22:48:33 +02:00
jan iversen
2232915ea8
Add parameter to delay sending of requests in modbus ( #54203 )
2021-08-07 21:10:08 -07:00
jan iversen
3d52bfc8f6
Simplify DATA_TYPE -> struct conversion. ( #53805 )
2021-07-31 23:17:23 +02:00
jan iversen
78ef02f4d9
Allow pymodbus to reconnect in running system (not startup) ( #53020 )
...
Allow pymodbus to reconnect (not during startup).
2021-07-19 13:01:50 +02:00
jan iversen
c360d6009c
copy() --> deepcopy(). ( #52794 )
2021-07-14 11:00:16 +02:00
jan iversen
fe1f7ba316
Add check for _client existence in modbus ( #52719 )
2021-07-08 11:58:51 +02:00
jan iversen
1cb298948f
Fix MODBUS connection type rtuovertcp does not connect ( #52505 )
...
* Correct host -> framer.
* Use function pointer
2021-07-05 11:45:50 +02:00
jan iversen
bc329cb602
Convert if/elif chains to dicts in modbus ( #51962 )
2021-06-18 11:20:44 +02:00
jan iversen
77f6d1f5cb
Do not return an exception in modbus ( #51829 )
2021-06-14 10:56:24 +02:00
jan iversen
50001684aa
Add retries/retry_on_empty configuration parameters to Modbus ( #51412 )
...
* Add retries/retry_on_empty configuration parameters.
* Please review comment.
2021-06-06 09:13:50 +02:00
jan iversen
59b5f94569
Add fix delay after send/request to allow RS485 adapter to switch in modbus ( #51417 )
2021-06-05 14:41:32 +02:00
jan iversen
b8afb7dcfe
Check initial connect() worked in modbus ( #51470 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Franck Nijhof <git@frenck.dev>
2021-06-05 14:39:09 +02:00
jan iversen
c74e65ac2d
Streamline modbus test_init ( #50990 )
...
* Streamline test_init.
* Review comments.
* Remove hub name.
2021-05-24 14:53:54 +02:00
jan iversen
b7fc537cd5
Remove non pymodbus_call from modbus.py. ( #50813 )
2021-05-19 11:39:53 +02:00
jan iversen
ba827db8ec
Update remaining modbus platforms to use pymodbus_call ( #50768 )
2021-05-17 22:12:18 +02:00
jan iversen
ff856a9bba
Simplify calls to pymodbus ( #50717 )
...
* simplify pymodbus_call.
Do not call with a function object and a check attribute, call instead
with CALL_TYPE*.
Avoid if <type> call x else call y.
Call async_pymodbus_call directly, instead of unpacking/packing.
* Declare call type in __init__.
* Modbus.py back to 100% test coverage.
2021-05-17 11:20:12 +02:00
jan iversen
ad7be91b6a
Fix modbus blocking threads ( #50619 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-05-15 19:54:17 +02:00
jan iversen
19cdff10c3
Add "close_comm_on_error" to modbus configuration ( #50583 )
2021-05-14 10:54:23 +02:00
jan iversen
70b09ed9a1
Handle relation between scan_interval and pymodbus timeout in modbus ( #50363 )
...
* Control scan_interval compared to pymodbus timeout.
add MINIMUM_SCAN_INTERVAL=5 seconds and validata with Voluptous.
Keep modbus.py 100% coverage.
* Please pylint.
* Review comments.
* pylint.
2021-05-10 19:28:38 +02:00
jan iversen
ec08256ff0
Do not use async_* in a modbus sync function ( #50343 )
2021-05-09 19:50:23 +02:00
jan iversen
29eb31e9da
Add configurable delay between connect and first request in modbus ( #50124 )
...
* Activate startup delay.
* Add removal of call_later if HA is stopped.
This is unlikely to happen, but just security measure.
* Removing timing interval.
async_fire_time_changed() needs to be called twice, first time the delay is
ended and second time update() is executed.
* Variable naming.
2021-05-08 13:28:35 +02:00
Vladimír Záhradník
e0de6752af
Fix incorrect attribute checks in Modbus hub ( #50241 )
2021-05-08 13:26:31 +02:00
jan iversen
7ac05110ca
Catch non payload modbus messages ( #49910 )
2021-05-02 00:03:52 +02:00
jan iversen
5b6d2edb48
Catch missing/unavailable response from modbus ( #49632 )
...
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-29 15:59:17 +02:00
jan iversen
33e8553d92
Fix frontend freeze due to modbus device not responding ( #49651 )
...
Changing the timeout from package default, secures SENDING will
timeout, and after 3 retries break off.
Remark: this commit is tested with pymodbus v2.5.1 the old version
v2.3.0 have several problems in this area.
self._value = await self.async_get_last_state()
pymodbus v2.5.1 is active on DEV (bumped in an earlier PR).
2021-04-25 23:11:01 +02:00
jan iversen
c9bdc9609c
Do not close non existing clients in modbus ( #49489 )
...
* Only close if _client is present.
* Remove del.
2021-04-21 11:46:40 +02:00
jan iversen
eb9ba527d0
Add pymodbus exception handling and isolate pymodbus to class modbusHub ( #49052 )
2021-04-19 08:18:15 -07:00
jan iversen
d5ef382fd5
Add modbus write coils ( #48676 )
...
* Add missing function in class.
write_coils was missing.
* Remove dead code.
The HA configuration secures that CONF_TYPE only contains legal values,
so having an empty assert to catch unknown values is dead code.
An empty assert is not informative.
2021-04-04 21:53:52 +02:00