Commit Graph

75 Commits (e874ba2a42d95b9312db9680023aa615f20bf542)

Author SHA1 Message Date
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 306498378c
Coverage 100% of Modbus climate (#67396)
* Coverage 100% of climate.py

* Allow 100% test.
2022-03-11 19:14:40 +02:00
jan iversen e891df0ff3
Allow multi read of Modbus sensor (#67378) 2022-02-28 11:07:55 -08:00
jan iversen 6ec9c402b1
Remove generic data types INT, UINT, FLOAT in modbus (#67268) 2022-02-26 13:27:48 -08:00
jan iversen 3173f1672b
Remove deprecated reverse_order and data_count from Modbus (#67236) 2022-02-25 08:01:03 -08:00
jan iversen cb877adb6a
Allow multiread in modbus binary_sensor (#59886) 2022-02-21 10:22:50 -08:00
jan iversen 4ca339c5b1
Set slave default to 0, as already documented in Modbus (#66921) 2022-02-20 11:56:38 +01:00
jan iversen d76687d672
Add support for INT8 and UINT8 in Modbus (#66889) 2022-02-19 17:17:29 +01:00
Tathar 16e5d7abe1
Add unique_id to modbus entities (#64634)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
2022-01-26 10:37:15 +01:00
jan iversen 42803e6ac0
Clean startup of modbus by moving service schemas (#57763) 2021-10-15 09:40:27 -07:00
jan iversen 4417ffb407
COnvert DATA_TYPE to enum. (#57699) 2021-10-15 07:09:59 +02:00
Robert Hillis 488a636aec
Clean up unused loggers (#57662) 2021-10-14 10:03:38 -07:00
jan iversen c7c789f618
Strictly type modbus __init__.py, validator.py (#56378)
* strictly type: __init__.py, validator.py
2021-09-21 13:43:41 +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
Matthias Alphart cd0ae66d58
Add CONF_STATE_CLASS to `sensor/__init__.py` (#54106)
* add CONF_STATE_CLASS to const.py

* move to `sensor/__init__.py`

* move to sensor/const.py

* Revert "move to sensor/const.py"

This reverts commit 604d0d066b.

* move it to `sensor/const.py` but import it from `sensor/__init__.py`

* add Modbus
2021-08-27 05:54:50 +02:00
jan iversen 7df8d0c973
Check for duplicate host/port and integration name in modbus (#54664)
* Check for duplicate host/port and integration name.

* Change to use set().

* Please CI.

* Add basic tests.
2021-08-25 12:29:00 +02:00
Matthias Alphart 51361fbd2b
Add configurable `state_class` to Modbus sensors (#54103)
* add configurable state_class

* Add test of new parameter.

Co-authored-by: jan Iversen <jancasacondor@gmail.com>
2021-08-25 11:50:54 +02:00
jan iversen 33f660118f
Add lazy_error_count to modbus (#54412)
* Add lazy_error_count.

* Use -=

* Review comments.
2021-08-21 15:49:50 +02:00
jan iversen 0688aaa2b6
Check for duplicate entity name/address in modbus entities (#54669)
* Check for duplicate entity name/address.
2021-08-19 09:37:31 +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 0f8a286cc7
Allow combinations write_coil/read_coils and write_coils/read_coil for modbus switch (#53856) 2021-08-02 14:55:52 +02:00
jan iversen 7306503756
Calculate count automatically in modbus platforms (#53116) 2021-07-20 22:49:54 -07:00
jan iversen 646862ec96
Add array write to turn_on/off in modbus switch/fan/light (#52582) 2021-07-12 11:22:53 -07:00
jan iversen 2ecfd74fa4
Add more data_types to modbus (#52423)
* Add more data_types.

* Use new struct when writing temperature.
2021-07-12 07:58:45 +02:00
jan iversen f1303e02ff
Let climate use base_struct_schema. (#52154) 2021-06-28 22:21:31 -07:00
jan iversen 1f4fdb50dc
Share struct validator between sensor and climate (#51935) 2021-06-23 11:03:17 -07:00
jan iversen bc329cb602
Convert if/elif chains to dicts in modbus (#51962) 2021-06-18 11:20:44 +02:00
jan iversen 7ad91fdf71
Add swap to climate and change data_count -> count in modbus (#51668) 2021-06-16 12:11:23 +02:00
jan iversen 2a51587bc3
Remove reverse_order (replaced by generic swap) (#51665)
Remove reverse_order (replaced by generic swap).
2021-06-11 11:41:41 +02:00
jan iversen 9e378d51af
Reduce modbus schemas and add delay to fan/light (#51664) 2021-06-11 09:22:47 +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 538a189168
Adjust modbus climate to use address/input_type (#51202) 2021-05-28 17:57:14 +02:00
jan iversen 00507539c1
Change Cover to use address/input_type (#51154)
* Change Cover to use address/input_type.

* Flake.
2021-05-28 13:23:44 +02:00
jan iversen 5afd16ef5d
Move modbus schema validators to validators.py (#51121) 2021-05-28 11:38:31 +02:00
Yuriy Sannikov 6391d75919
Refactor ModbusRegisterSensor class to get hub and configuration (#50234)
* refactor ModbusRegisterSensor to match the ModbusSwitch interface

* Please pylint, mypy etc.

* Remove PLATFORM.

Co-authored-by: jan Iversen <jancasacondor@gmail.com>
2021-05-26 19:28:14 +02:00
jan iversen be13a73db8
Allow manual scan and add delay in switch verify. (#50974) 2021-05-24 12:59:55 +02:00
Vladimír Záhradník c979101a02
Add Modbus fan integration (#48558)
* Add Modbus fan entity

* Update to PR.

* Pylint.

Co-authored-by: jan Iversen <jancasacondor@gmail.com>
2021-05-21 09:56:47 +02:00
Vladimír Záhradník 80d172140f
Add Modbus light integration (#42120)
* Add  Modbus Light and add unit tests

* Update to original PR.

* Review comments.

* Review 2.

Co-authored-by: jan Iversen <jancasacondor@gmail.com>
2021-05-21 08:57:17 +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 552ca1c57b
Fix modbus switch problems (#50117) 2021-05-07 22:12:13 +02:00
jan iversen 684ea9e49b
Restructure modbus switch, and solve read/write conflicts (#49386)
Remove old style configuration from switch.
- The old style configuration allowed a number of illegal
  configurations, instead of adding if...log. in setup we
  only support the new configuration style.

Add new/changed configuration switch.

Removed verify_state and cleaned configuration to avoid possible
illegal configurations.
2021-04-30 16:47:18 +02:00
jan iversen e5e215353d
Add swap byte/word/byteword option to modbus sensor (#49719)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-04-27 10:49:41 +02:00
Marc Mueller 1a38d2089d
Bump python-typing-update to v0.3.3 (#48992)
* Bump python-typing-update to 0.3.3
* Changes after update
2021-04-10 15:21:11 +02:00
jan iversen 2511e1f229
Remove modbus duplicate strings (#48654)
* Reuse HA constants for serial configuration.

Reusing HA consts reduces the need for translation.

Sort/group constants in const.

* Change const name ATTR_* to CONF_*

* Correct wrong import

* ATTR_* for service and CONF_* for schemas.

* Revert change to service call.

* Rename CONF_TEMPERATURE -> ATTR_TEMPERATURE

Avoid possible division problem in set_temperature.
2021-04-04 14:02:47 +02:00
jan iversen 23fae255ff
Make modbus WRITE_COIL use write_coils in case of an array (#48633)
* WRITE_COIL uses write_coils in case of an array.

WRITE_REGISTER uses write_register/write_registers depending
on whether value is singular or an array.

WRITE_COIL is modified to be similar and uses
write_coil/write_coils depending on whether value is singular or an
array.

* Update SERVICE_WRITE_COIL to allow list.
2021-04-03 13:15:01 +02:00
jan iversen cee43b0670
Add modbus CONF_VERIFY_STATE to new switch config (#48632)
Missed CONF_VERIFY_STATE in new switch config, when
copying from old switch config.
2021-04-03 11:00:06 +02:00