Add onewire support for DS2413 (#55921)
This commit is contained in:
parent
12b6922875
commit
49b07224bf
3 changed files with 70 additions and 0 deletions
|
@ -57,6 +57,15 @@ DEVICE_BINARY_SENSORS: dict[str, tuple[OneWireBinarySensorEntityDescription, ...
|
|||
)
|
||||
for id in DEVICE_KEYS_0_7
|
||||
),
|
||||
"3A": tuple(
|
||||
OneWireBinarySensorEntityDescription(
|
||||
key=f"sensed.{id}",
|
||||
entity_registry_enabled_default=False,
|
||||
name=f"Sensed {id}",
|
||||
read_mode=READ_MODE_BOOL,
|
||||
)
|
||||
for id in DEVICE_KEYS_A_B
|
||||
),
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -84,6 +84,15 @@ DEVICE_SWITCHES: dict[str, tuple[OneWireEntityDescription, ...]] = {
|
|||
for id in DEVICE_KEYS_0_7
|
||||
]
|
||||
),
|
||||
"3A": tuple(
|
||||
OneWireSwitchEntityDescription(
|
||||
key=f"PIO.{id}",
|
||||
entity_registry_enabled_default=False,
|
||||
name=f"PIO {id}",
|
||||
read_mode=READ_MODE_BOOL,
|
||||
)
|
||||
for id in DEVICE_KEYS_A_B
|
||||
),
|
||||
}
|
||||
|
||||
LOGGER = logging.getLogger(__name__)
|
||||
|
|
|
@ -656,6 +656,57 @@ MOCK_OWPROXY_DEVICES = {
|
|||
},
|
||||
],
|
||||
},
|
||||
"3A.111111111111": {
|
||||
"inject_reads": [
|
||||
b"DS2413", # read device type
|
||||
],
|
||||
"device_info": {
|
||||
ATTR_IDENTIFIERS: {(DOMAIN, "3A.111111111111")},
|
||||
ATTR_MANUFACTURER: MANUFACTURER,
|
||||
ATTR_MODEL: "DS2413",
|
||||
ATTR_NAME: "3A.111111111111",
|
||||
},
|
||||
BINARY_SENSOR_DOMAIN: [
|
||||
{
|
||||
"entity_id": "binary_sensor.3a_111111111111_sensed_a",
|
||||
"unique_id": "/3A.111111111111/sensed.A",
|
||||
"injected_value": b" 1",
|
||||
"result": STATE_ON,
|
||||
ATTR_UNIT_OF_MEASUREMENT: None,
|
||||
ATTR_DEVICE_CLASS: None,
|
||||
"disabled": True,
|
||||
},
|
||||
{
|
||||
"entity_id": "binary_sensor.3a_111111111111_sensed_b",
|
||||
"unique_id": "/3A.111111111111/sensed.B",
|
||||
"injected_value": b" 0",
|
||||
"result": STATE_OFF,
|
||||
ATTR_UNIT_OF_MEASUREMENT: None,
|
||||
ATTR_DEVICE_CLASS: None,
|
||||
"disabled": True,
|
||||
},
|
||||
],
|
||||
SWITCH_DOMAIN: [
|
||||
{
|
||||
"entity_id": "switch.3a_111111111111_pio_a",
|
||||
"unique_id": "/3A.111111111111/PIO.A",
|
||||
"injected_value": b" 1",
|
||||
"result": STATE_ON,
|
||||
ATTR_UNIT_OF_MEASUREMENT: None,
|
||||
ATTR_DEVICE_CLASS: None,
|
||||
"disabled": True,
|
||||
},
|
||||
{
|
||||
"entity_id": "switch.3a_111111111111_pio_b",
|
||||
"unique_id": "/3A.111111111111/PIO.B",
|
||||
"injected_value": b" 0",
|
||||
"result": STATE_OFF,
|
||||
ATTR_UNIT_OF_MEASUREMENT: None,
|
||||
ATTR_DEVICE_CLASS: None,
|
||||
"disabled": True,
|
||||
},
|
||||
],
|
||||
},
|
||||
"3B.111111111111": {
|
||||
"inject_reads": [
|
||||
b"DS1825", # read device type
|
||||
|
@ -940,6 +991,7 @@ MOCK_SYSBUS_DEVICES = {
|
|||
],
|
||||
},
|
||||
"29-111111111111": {SENSOR_DOMAIN: []},
|
||||
"3A-111111111111": {SENSOR_DOMAIN: []},
|
||||
"3B-111111111111": {
|
||||
"device_info": {
|
||||
ATTR_IDENTIFIERS: {(DOMAIN, "3B-111111111111")},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue