Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use loader.async_suggest_report_issue in vacuum #101391

Merged
merged 2 commits into from
Oct 5, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 9 additions & 4 deletions homeassistant/components/vacuum/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from homeassistant.helpers.entity_platform import EntityPlatform
from homeassistant.helpers.icon import icon_for_battery_level
from homeassistant.helpers.typing import ConfigType
from homeassistant.loader import bind_hass
from homeassistant.loader import async_suggest_report_issue, bind_hass

_LOGGER = logging.getLogger(__name__)

Expand Down Expand Up @@ -398,16 +398,21 @@ def add_to_platform_start(
"platform": self.platform.platform_name,
frenck marked this conversation as resolved.
Show resolved Hide resolved
},
)

report_issue = async_suggest_report_issue(
hass,
integration_domain=self.platform.platform_name,
module=type(self).__module__,
)
_LOGGER.warning(
(
"%s::%s is extending the deprecated base class VacuumEntity instead of "
"StateVacuumEntity, this is not valid and will be unsupported "
"from Home Assistant 2024.2. Please report it to the author of the '%s'"
" custom integration"
"from Home Assistant 2024.2. Please %s"
),
self.platform.platform_name,
self.__class__.__name__,
self.platform.platform_name,
report_issue,
)

entity_description: VacuumEntityDescription
Expand Down
1 change: 1 addition & 0 deletions tests/components/vacuum/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ async def async_setup_entry_init(
TEST_DOMAIN,
async_setup_entry=async_setup_entry_init,
),
built_in=False,
)

entity1 = VacuumEntity()
Expand Down