Enable homeassistant.update_entity service for all modbus platforms (#49918)
* Rename _update() to update() A platform neeed a function update(), even though polling is false, this is due to the service: homeassistant.update_entity, which calls update() * Update test harnesss to script testing. Test homeassistant.update_entity in all platforms. This call calls update() in the platform to get a new reading. * Add reuse parameter. * Move service call from helper to tests. * Change run_service_update --> prepare_service_update. * Remove entity_id parameter.
This commit is contained in:
parent
1bd9826684
commit
8adbc62a6e
11 changed files with 188 additions and 21 deletions
|
@ -201,3 +201,21 @@ async def base_config_test(
|
|||
config_modbus=config_modbus,
|
||||
expect_init_to_fail=expect_init_to_fail,
|
||||
)
|
||||
|
||||
|
||||
async def prepare_service_update(hass, config):
|
||||
"""Run test for service write_coil."""
|
||||
|
||||
config_modbus = {
|
||||
DOMAIN: {
|
||||
CONF_NAME: DEFAULT_HUB,
|
||||
CONF_TYPE: "tcp",
|
||||
CONF_HOST: "modbusTest",
|
||||
CONF_PORT: 5001,
|
||||
**config,
|
||||
},
|
||||
}
|
||||
assert await async_setup_component(hass, DOMAIN, config_modbus)
|
||||
await hass.async_block_till_done()
|
||||
assert await async_setup_component(hass, "homeassistant", {})
|
||||
await hass.async_block_till_done()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue