Remove unsupported vacuum service handlers (#95787)

* Prevent implementing unsupported vacuum service handlers

* Remove unsupported service handlers

* Update test
This commit is contained in:
Erik Montnemery 2023-07-10 15:03:40 +02:00 committed by GitHub
parent df229e655b
commit 39208a3749
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 17 deletions

View File

@ -429,12 +429,6 @@ class VacuumEntity(_BaseVacuum, ToggleEntity):
"""
await self.hass.async_add_executor_job(partial(self.start_pause, **kwargs))
async def async_pause(self) -> None:
"""Not supported."""
async def async_start(self) -> None:
"""Not supported."""
@dataclass
class StateVacuumEntityDescription(EntityDescription):
@ -482,12 +476,3 @@ class StateVacuumEntity(_BaseVacuum):
This method must be run in the event loop.
"""
await self.hass.async_add_executor_job(self.pause)
async def async_turn_on(self, **kwargs: Any) -> None:
"""Not supported."""
async def async_turn_off(self, **kwargs: Any) -> None:
"""Not supported."""
async def async_toggle(self, **kwargs: Any) -> None:
"""Not supported."""

View File

@ -241,8 +241,8 @@ async def test_unsupported_methods(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
assert vacuum.is_on(hass, ENTITY_VACUUM_COMPLETE)
await common.async_pause(hass, ENTITY_VACUUM_COMPLETE)
assert vacuum.is_on(hass, ENTITY_VACUUM_COMPLETE)
with pytest.raises(AttributeError):
await common.async_pause(hass, ENTITY_VACUUM_COMPLETE)
hass.states.async_set(ENTITY_VACUUM_COMPLETE, STATE_OFF)
await hass.async_block_till_done()