Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion homeassistant/components/modbus/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
ATTR_ADDRESS = CONF_ADDRESS
ATTR_HUB = "hub"
ATTR_UNIT = "unit"
ATTR_SLAVE = "slave"
ATTR_SLAVE = "device_id"
ATTR_VALUE = "value"


Expand Down
8 changes: 4 additions & 4 deletions tests/components/modbus/test_climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ async def test_hvac_onoff_values(hass: HomeAssistant, mock_modbus) -> None:
)
await hass.async_block_till_done()

mock_modbus.write_register.assert_called_with(11, value=0xAA, slave=10)
mock_modbus.write_register.assert_called_with(11, value=0xAA, device_id=10)

await hass.services.async_call(
CLIMATE_DOMAIN,
Expand All @@ -477,7 +477,7 @@ async def test_hvac_onoff_values(hass: HomeAssistant, mock_modbus) -> None:
)
await hass.async_block_till_done()

mock_modbus.write_register.assert_called_with(11, value=0xFF, slave=10)
mock_modbus.write_register.assert_called_with(11, value=0xFF, device_id=10)


@pytest.mark.parametrize(
Expand Down Expand Up @@ -506,7 +506,7 @@ async def test_hvac_onoff_coil(hass: HomeAssistant, mock_modbus) -> None:
)
await hass.async_block_till_done()

mock_modbus.write_coil.assert_called_with(11, value=1, slave=10)
mock_modbus.write_coil.assert_called_with(11, value=1, device_id=10)

await hass.services.async_call(
CLIMATE_DOMAIN,
Expand All @@ -516,7 +516,7 @@ async def test_hvac_onoff_coil(hass: HomeAssistant, mock_modbus) -> None:
)
await hass.async_block_till_done()

mock_modbus.write_coil.assert_called_with(11, value=0, slave=10)
mock_modbus.write_coil.assert_called_with(11, value=0, device_id=10)


@pytest.mark.parametrize(
Expand Down
6 changes: 3 additions & 3 deletions tests/components/modbus/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ async def test_pb_service_write(
assert func_name[do_write[FUNC]].called
assert func_name[do_write[FUNC]].call_args.args == (data[ATTR_ADDRESS],)
assert func_name[do_write[FUNC]].call_args.kwargs == {
"slave": 17,
ATTR_SLAVE: 17,
value_arg_name[do_write[FUNC]]: data[do_write[DATA]],
}

Expand Down Expand Up @@ -1326,7 +1326,7 @@ async def test_check_default_slave(
"""Test default slave."""
assert mock_modbus.read_holding_registers.mock_calls
first_call = mock_modbus.read_holding_registers.mock_calls[0]
assert first_call.kwargs["slave"] == expected_slave_value
assert first_call.kwargs[ATTR_SLAVE] == expected_slave_value


@pytest.mark.parametrize(
Expand Down Expand Up @@ -1407,7 +1407,7 @@ async def test_pb_service_write_no_slave(
assert func_name[do_write[FUNC]].called
assert func_name[do_write[FUNC]].call_args.args == (data[ATTR_ADDRESS],)
assert func_name[do_write[FUNC]].call_args.kwargs == {
"slave": 1,
ATTR_SLAVE: 1,
value_arg_name[do_write[FUNC]]: data[do_write[DATA]],
}

Expand Down