Commit Graph

177 Commits (175f207d28f0d063da3d9be6c55d758723909d57)

Author SHA1 Message Date
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 8d4aac618d
Allow same IP if ports are different on modbus (#55766) 2021-09-06 13:40:15 -07:00
jan iversen cac3e1acfa
Allow same address different register types in modbus (#55767) 2021-09-06 13:35:40 -07:00
jan iversen 69aba2a6a1
Correct duplicate address. (#55578) 2021-09-02 13:53:38 +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
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 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 d60f5e1721
Add missing convert to fan/light/switch modbus platform (#55203) 2021-08-25 21:02:06 +02:00
jan iversen d4064e7044
Cancel entity timers. (#55141) 2021-08-25 14:49:37 +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 1f6d18c517
Set quality level of modbus to gold (#54926)
* Prepare for gold.

* Upgrade to gold.
2021-08-20 17:59:31 +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 bec42b74fe
Solve switch/verify register type convert problem in modbus (#54645) 2021-08-15 19:57:37 -07:00
Erik Montnemery 2720ba2753
Move temperature conversions to sensor base class (4/8) (#54472)
* Move temperature conversions to entity base class (4/8)

* Fix litterrobot sensor

* Fix tests
2021-08-11 21:17:47 +02:00
jan iversen 54538bb72b
Bump pymodbus version to 2.5.3rc1 (#54318) 2021-08-10 10:16:38 +02:00
jan iversen 02459e6813
Convert last properties in modbus to _attr_variable (#53919) 2021-08-08 23:23:21 +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 8a4674c086
Solve missing automatic update of struct configuration in modbus (#54193) 2021-08-07 21:11:56 -07:00
jan iversen 2232915ea8
Add parameter to delay sending of requests in modbus (#54203) 2021-08-07 21:10:08 -07:00
jan iversen b2fffdd13e
Add temporary fix to modbus to solve upstream problem (#53857) 2021-08-04 17:03:31 -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 3d52bfc8f6
Simplify DATA_TYPE -> struct conversion. (#53805) 2021-07-31 23:17:23 +02:00
Marc Mueller 0815eede4b
Replace lists with tuples (2) (#53685) 2021-07-30 01:20:03 +02:00
jan iversen cfb0def718
Change integration modbus to use _attr variables (#53511) 2021-07-26 21:20:34 +02:00
jan iversen 7306503756
Calculate count automatically in modbus platforms (#53116) 2021-07-20 22:49:54 -07:00
jan iversen 2e2b340b1e
Set modbus entity to non-available unless scan_interval=0 (#53155) 2021-07-20 22:48:02 -07:00
Franck Nijhof 059a9bc8ed
Fix modbus setting string as temperature in climate platform (#53249) 2021-07-20 22:03:10 +02:00
jan iversen 8c43e5c736
Correct set_temperature in modbus climate (#52923) 2021-07-20 20:19:26 +02:00
jan iversen 78a8ba99f9
Upgrade modbus to quality level "silver". (#53186) 2021-07-19 23:57:28 -05:00
jan iversen 19a282255b
Remove duplicate functions in modbus climate/sensor. (#53141)
Convert all data types correctly for climate.
2021-07-19 23:52:58 -05: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 12ac666459
only allow one active call in each platform. (#52823) 2021-07-13 21:45:42 +02:00
Lincoln Kirchoff ac39607ae9
Fix modbus climate precision configuration variable (#52651)
* Updated precision to follow the tenths, halves, whole notation used by
other home assistant climate modules. Added the precision @property so
that home assistant can handle this rounding in the frontend, rather
than in the _async_read_register() method.

* Fixed a pylinter error for periods in user-facing log messages, and
updated `precision` defaults in components/modbus/__init__.py to be
consistent with an error case, using `PRECISION_WHOLE`.

* revert changes to `precision:` configuration variable
instead, the climate `precision()` function will infer whether or not
to display in whole or tenths. halves will be unsupported, which should
be fine.

* re-added missing line that was removed

* revert change to use self._input_type instead of CALL_TYPE_REGISTER_HOLDING
2021-07-13 10:36:54 +02: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 5caf170c78
Correct Wrong "raise" in modbus validators. (#52924) 2021-07-12 11:06:31 -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 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 f1303e02ff
Let climate use base_struct_schema. (#52154) 2021-06-28 22:21:31 -07:00
jan iversen c558c77413
Correct keyerror exception. (#52150) 2021-06-26 20:09:53 +02: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 77f6d1f5cb
Do not return an exception in modbus (#51829) 2021-06-14 10:56:24 +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