Commit graph

36 commits

Author SHA1 Message Date
Franck Nijhof
d3ed8de232
Update Ruff to v0.0.247 ()
* Update Ruff to v0.0.247

* Fix new found violations
2023-02-15 16:46:03 -05:00
epenet
50cbabb2d8
Add type hints to integration tests (part 15) () 2023-02-15 10:00:49 +01:00
jan iversen
b9b5a279f2
Correct sensor restore entity in modbus ()
* Correct sensor restore entity.

* Review comments.
2023-02-09 21:35:44 +01:00
epenet
f75ac17554
Add type hints to integration tests (j-m) () 2023-02-08 19:06:59 +01:00
epenet
810367b757
Fix can not typo () 2023-02-03 11:37:16 +01:00
GrahamJB1
8bff95014c
Add modbus min/max values ()
* modbus min/max values
Co-authored-by: jan iversen <jancasacondor@gmail.com>
2023-02-02 22:29:03 +01:00
GrahamJB1
200d3ae845
modbus slave unique ids ()
modbus slave unique ids
2023-01-19 11:08:11 +01:00
jan iversen
15176300e2
Add full test of wrap option ()
fixes undefined
2022-11-22 09:57:04 +01:00
jan iversen
d2e5c85429
Remove pragma from discover check. () 2022-03-11 19:58:18 +02:00
jan iversen
a4915eb704
Handle exception in modbus slave sensor () 2022-03-02 09:49:57 -08:00
jan iversen
e891df0ff3
Allow multi read of Modbus sensor () 2022-02-28 11:07:55 -08:00
jan iversen
8233278ccc
Correct tests to use data_type in Modbus () 2022-02-25 11:37:52 -08:00
jan iversen
8741ff0684
Diferentiate between attr_name and entity_id in Modbus tests () 2022-02-21 14:56:31 -08:00
Dave T
e64352a7e0
Use new enums in modbus tests () 2021-12-22 10:03:11 +01:00
jan iversen
cca7da77ad
Report modbus buffer too small or too big to unpack () 2021-10-20 15:22:01 -07:00
jan iversen
34984d78a1
Add float32 test to modbus () 2021-10-15 16:06:36 -07:00
jan iversen
4417ffb407
COnvert DATA_TYPE to enum. () 2021-10-15 07:09:59 +02:00
jan iversen
199cf649be
Add test of lazy_error in modbus () 2021-10-11 12:43:05 +02:00
jan iversen
6947912fa9
Modbus entity update does not occur until after scan_interval ()
* Secure update is called when integration is started.

* Review comments.

* Update homeassistant/components/modbus/base_platform.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Update homeassistant/components/modbus/base_platform.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-09-18 08:57:27 +02:00
Matthias Alphart
cd0ae66d58
Add CONF_STATE_CLASS to sensor/__init__.py ()
* 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
Matthias Alphart
51361fbd2b
Add configurable state_class to Modbus sensors ()
* 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
f91d214ba4
Break out mock of pymodbus return from mock_modbus to new fixture ()
* Remove unused mock_modbus.

* Break out mock pymodbus return values.

* Review comments.
2021-08-23 23:55:57 +02:00
jan iversen
da20552cd8
Remove base_test from modbus test harness ()
* Remove base_test.

* Review comments.
2021-08-22 19:59:38 +02:00
jan iversen
33f660118f
Add lazy_error_count to modbus ()
* Add lazy_error_count.

* Use -=

* Review comments.
2021-08-21 15:49:50 +02:00
jan iversen
71b0f6d095
set common test entity name. () 2021-08-17 20:43:27 +02:00
jan iversen
4ef9269790
Replace prepare_service_call with a simpler fixture in modbus ()
* Convert prepare_service_call to a fixture.
2021-08-11 12:42:28 +02:00
jan iversen
e7f0768ae6
Convert base_config_test in modbus to existing Pytest.fixture ()
* Convert base_config_test to pytest.fixture.
2021-08-09 12:11:54 +02:00
jan iversen
7306503756
Calculate count automatically in modbus platforms () 2021-07-20 22:49:54 -07:00
jan iversen
2e2b340b1e
Set modbus entity to non-available unless scan_interval=0 () 2021-07-20 22:48:02 -07:00
jan iversen
2ecfd74fa4
Add more data_types to modbus ()
* Add more data_types.

* Use new struct when writing temperature.
2021-07-12 07:58:45 +02:00
jan iversen
c0751c060f
review comments. () 2021-06-30 14:34:33 +02:00
jan iversen
74e1600a84
Add fixture to handle mock restore state () 2021-06-28 22:21:04 -07:00
jan iversen
08b0ef7a5e
Use test fixture for configuration testing ()
* Autospec mock_modbus and usei for configuration.

* Review comment.
2021-06-17 12:27:05 +02:00
jan iversen
2a51587bc3
Remove reverse_order (replaced by generic swap) ()
Remove reverse_order (replaced by generic swap).
2021-06-11 11:41:41 +02:00
jan iversen
8d365e8bf5
After merge, review. () 2021-05-27 08:28:31 +02:00
Yuriy Sannikov
6391d75919
Refactor ModbusRegisterSensor class to get hub and configuration ()
* 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
Renamed from tests/components/modbus/test_modbus_sensor.py (Browse further)