Add system options to config entries (#25926)
* Add system options to config entries * For feedback * Follow most of balloobs comments * Fix balloobs comments * Improvements * Fix second round of Balloobs comments * Fix third round * Add system options to mock config entry * Fix integration tests * Fix the last failing tests * Fix disabled string * Fix failing disabled_by tests * New tests * Config entry WS API tests * Fix comments
This commit is contained in:
parent
fc716a45c9
commit
a2589f56e1
29 changed files with 254 additions and 27 deletions
|
@ -596,6 +596,22 @@ async def test_updating_entry_data(manager):
|
|||
assert entry.data == {"second": True}
|
||||
|
||||
|
||||
async def test_updating_entry_system_options(manager):
|
||||
"""Test that we can update an entry data."""
|
||||
entry = MockConfigEntry(
|
||||
domain="test",
|
||||
data={"first": True},
|
||||
state=config_entries.ENTRY_STATE_SETUP_ERROR,
|
||||
system_options={"disable_new_entities": True},
|
||||
)
|
||||
entry.add_to_manager(manager)
|
||||
|
||||
assert entry.system_options.disable_new_entities
|
||||
|
||||
entry.system_options.update(disable_new_entities=False)
|
||||
assert not entry.system_options.disable_new_entities
|
||||
|
||||
|
||||
async def test_update_entry_options_and_trigger_listener(hass, manager):
|
||||
"""Test that we can update entry options and trigger listener."""
|
||||
entry = MockConfigEntry(domain="test", options={"first": True})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue