Files
core/tests/components
clssn 15b1a9ecea Add numato integration (#33816)
* Add support for Numato 32 port USB GPIO boards

Included are a binary_sensor, sensor and switch component
implementations. The binary_sensor interface pushes updates via
registered callback functions, so no need to poll here.

Unit tests are included to test against a Numato device mockup.

* Refactor numato configuration due to PR finding

* Resolve minor review findings

* Bump numato-gpio requirement

* Load numato platforms during domain setup

According to review finding

* Guard from platform setup without discovery_info

According to review finding

* Move numato API state into hass.data

According to review finding.

* Avoid side effects in numato entity constructors

According to review finding

* Keep only first line of numato module docstrings

Removed reference to the documentation. Requested by reviewer.

* Minor improvements inspired by review findings

* Fix async tests

Pytest fixture was returning from the yield too early executing teardown
code during test execution.

* Improve test coverage

* Configure GPIO ports early

Review finding

* Move read_gpio callback to outside the loop

Also continue on failed switch setup, resolve other minor review
findings and correct some error messages

* Bump numato-gpio requirement

This fixes a crash during cleanup. When any device had a communication
problem, its cleanup would raise an exception which was not handled,
fell through to the caller and prevented the remaining devices from
being cleaned up.

* Call services directly

Define local helper functions for better readability.
Resolves a review finding.

* Assert something in every test

So not only coverage is satisfied but things are actually tested
to be in the expected state.
Resolves a review finding.

* Clarify scope of notification tests

Make unit test for hass NumatoAPI independent of Home Assistant (very basic test of notifications).
Improve the regular operations test for notifications.

* Test for hass.states after operating switches

Resolves a review finding.

* Check for wrong port directions

* WIP: Split numato tests to multiple files

test_hass_binary_sensor_notification still fails.

* Remove pytest asyncio decorator

Apears to be redundant. Resolves a review finding.

* Call switch services directly.

Resolves a review finding.

* Remove obsolete inline pylint config

Co-Authored-By: Martin Hjelmare <marhje52@gmail.com>

* Improve the numato_gpio module mockup

Resolves a review finding.

* Remove needless explicit conversions to str

Resolves review findings.

* Test setup of binary_sensor callbacks

* Fix test_hass_binary_sensor_notification

* Add forgotten await

Review finding.

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2020-04-30 14:23:30 +02:00
..
2020-04-09 00:57:47 +02:00
2020-04-25 14:32:55 -07:00
2020-04-25 14:32:55 -07:00
2019-07-31 12:25:30 -07:00
2020-04-10 19:17:46 +02:00
2020-04-25 14:32:55 -07:00
2020-04-25 14:32:55 -07:00
2020-04-25 14:32:55 -07:00
2019-12-04 22:47:40 -08:00
2019-07-31 12:25:30 -07:00
2019-07-31 12:25:30 -07:00
2020-04-25 14:32:55 -07:00
2019-04-14 16:59:06 -07:00
2019-12-31 13:05:31 +01:00
2020-04-24 15:09:45 -07:00
2020-04-04 22:31:56 +02:00
2020-03-10 23:00:30 +01:00
2020-04-25 14:32:55 -07:00
2020-04-28 10:31:22 -07:00
2020-02-08 13:10:59 +01:00
2020-04-25 14:32:55 -07:00
2019-07-31 12:25:30 -07:00
2020-04-25 14:32:55 -07:00
2020-03-09 14:07:50 -07:00
2020-04-10 19:17:46 +02:00
2020-04-28 10:31:22 -07:00
2019-07-31 12:25:30 -07:00
2020-04-25 14:32:55 -07:00
2020-04-30 14:23:30 +02:00
2020-01-29 18:18:24 +01:00
2019-07-31 12:25:30 -07:00
2020-04-28 10:31:22 -07:00
2020-04-28 10:31:22 -07:00
2019-12-04 22:47:40 -08:00
2019-12-04 22:47:40 -08:00
2020-04-25 14:32:55 -07:00
2020-04-21 21:06:23 -07:00
2020-01-14 13:03:02 -08:00
2020-02-25 16:37:41 -07:00
2020-04-25 14:32:55 -07:00
2020-04-25 14:32:55 -07:00
2020-04-09 00:57:47 +02:00
2019-07-31 12:25:30 -07:00
2019-07-31 12:25:30 -07:00
2020-04-25 14:32:55 -07:00
2020-01-31 08:33:00 -08:00
2020-04-27 01:57:29 +02:00
2019-07-31 12:25:30 -07:00
2020-04-08 19:18:09 -05:00
2020-04-25 14:32:55 -07:00
2020-01-03 14:47:06 +01:00
2020-04-25 15:40:44 -07:00
2020-04-24 15:09:45 -07:00
2020-04-11 15:40:59 +02:00
2020-03-18 18:14:25 -07:00
2020-04-28 10:31:22 -07:00
2016-03-09 10:25:50 +01:00