Add discovery of sensors on DS2409 MicroLan (#43599)

* Add discovery of sensors on DS2409 MicroLan

* Add tests for coupler

* Update tests

* Fix isort

* Clean up

* Move tests to test_sensor.py

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Andreas Wrede 2020-12-06 20:09:32 -05:00 committed by GitHub
parent 9c63fbfcb1
commit 30f73a4962
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 161 additions and 16 deletions

View file

@ -179,6 +179,18 @@ MOCK_DEVICE_SENSORS = {
},
],
},
"1F.111111111111": {
"inject_reads": [
b"DS2409", # read device type
],
"device_info": {
"identifiers": {(DOMAIN, "1F.111111111111")},
"manufacturer": "Maxim Integrated",
"model": "DS2409",
"name": "1F.111111111111",
},
SENSOR_DOMAIN: [],
},
"22.111111111111": {
"inject_reads": [
b"DS1822", # read device type
@ -752,3 +764,6 @@ async def test_owserver_setup_valid_device(owproxy, hass, device_id, platform):
assert state is None
else:
assert state.state == expected_sensor["result"]
assert state.attributes["device_file"] == expected_sensor.get(
"device_file", registry_entry.unique_id
)