Rename VacuumDevice to VacuumEntity (#34674)
This commit is contained in:
1 parent
90e0a1af8a
commit
d3ed80cf53
12 files changed
+66
-24
No files matched your search
@@ -228,7 +228,7 @@ async def test_unsupported_methods(hass):
|
||||
assert "spot" not in state.attributes.get(ATTR_STATUS)
|
||||
assert state.state == STATE_OFF
|
||||
|
||||
# VacuumDevice should not support start and pause methods.
|
||||
# VacuumEntity should not support start and pause methods.
|
||||
hass.states.async_set(ENTITY_VACUUM_COMPLETE, STATE_ON)
|
||||
await hass.async_block_till_done()
|
||||
assert vacuum.is_on(hass, ENTITY_VACUUM_COMPLETE)
|
||||
@@ -243,7 +243,7 @@ async def test_unsupported_methods(hass):
|
||||
await common.async_start(hass, ENTITY_VACUUM_COMPLETE)
|
||||
assert not vacuum.is_on(hass, ENTITY_VACUUM_COMPLETE)
|
||||
|
||||
# StateVacuumDevice does not support on/off
|
||||
# StateVacuumEntity does not support on/off
|
||||
await common.async_turn_on(hass, entity_id=ENTITY_VACUUM_STATE)
|
||||
state = hass.states.get(ENTITY_VACUUM_STATE)
|
||||
assert state.state != STATE_CLEANING
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
"""The tests for Vacuum."""
|
||||
from homeassistant.components import vacuum
|
||||
|
||||
|
||||
def test_deprecated_base_class(caplog):
|
||||
"""Test deprecated base class."""
|
||||
|
||||
class CustomVacuum(vacuum.VacuumDevice):
|
||||
pass
|
||||
|
||||
class CustomStateVacuum(vacuum.StateVacuumDevice):
|
||||
pass
|
||||
|
||||
CustomVacuum()
|
||||
assert "VacuumDevice is deprecated, modify CustomVacuum" in caplog.text
|
||||
|
||||
CustomStateVacuum()
|
||||
assert "StateVacuumDevice is deprecated, modify CustomStateVacuum" in caplog.text
|
||||
Reference in new issue
Block a user