-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Fix deprecated vacuum states in vacuum entity #244
Conversation
Fixing error: 2025-01-14 19:52:56.113 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_CLEANING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.CLEANING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.128 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_DOCKED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.DOCKED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.139 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_PAUSED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.PAUSED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.155 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_IDLE was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.IDLE instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.168 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_RETURNING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.RETURNING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.183 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_ERROR was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.ERROR instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.193 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_CLEANING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.CLEANING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.205 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_DOCKED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.DOCKED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.215 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_PAUSED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.PAUSED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.225 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_IDLE was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.IDLE instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.238 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_RETURNING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.RETURNING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.248 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_ERROR was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.ERROR instead, please report it to the author of the 'zcsmower' custom integration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work. Thank you! I think we have wrong syntaxt and need only one line:
from homeassistant.components.vacuum import (
ATTR_STATUS,
StateVacuumEntity,
StateVacuumEntityDescription,
VacuumActivity,
VacuumEntityFeature,
)
I also fixed the state names... sorry but I didn't test the fix before pushing :) With the latest PR I sent it should be ok |
@@ -24,8 +19,8 @@ | |||
LOGGER, | |||
DOMAIN, | |||
) | |||
from .coordinator import ZcsMowerDataUpdateCoordinator | |||
from .entity import ZcsMowerRobotEntity | |||
from .coordinator import ZcsDataUpdateCoordinator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from .coordinator import ZcsDataUpdateCoordinator | |
from .coordinator import ZcsMowerDataUpdateCoordinator |
from .coordinator import ZcsMowerDataUpdateCoordinator | ||
from .entity import ZcsMowerRobotEntity | ||
from .coordinator import ZcsDataUpdateCoordinator | ||
from .entity import ZcsMowerEntity |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from .entity import ZcsMowerEntity | |
from .entity import ZcsMowerRobotEntity |
@@ -37,7 +32,7 @@ | |||
| VacuumEntityFeature.START | |||
| VacuumEntityFeature.MAP | |||
) | |||
ROBOT_ENTITY_DESCRIPTIONS = ( | |||
ENTITY_DESCRIPTIONS = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ENTITY_DESCRIPTIONS = ( | |
ROBOT_ENTITY_DESCRIPTIONS = ( |
@@ -55,21 +50,21 @@ async def async_setup_entry( | |||
coordinator = config_entry.runtime_data | |||
async_add_entities( | |||
[ | |||
ZcsMowerRobotVacuumEntity( | |||
ZcsMowerVacuumEntity( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ZcsMowerVacuumEntity( | |
ZcsMowerRobotVacuumEntity( |
hass=hass, | ||
config_entry=config_entry, | ||
coordinator=coordinator, | ||
entity_description=entity_description, | ||
imei=imei, | ||
) | ||
for imei in coordinator.mowers | ||
for entity_description in ROBOT_ENTITY_DESCRIPTIONS | ||
for entity_description in ENTITY_DESCRIPTIONS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for entity_description in ENTITY_DESCRIPTIONS | |
for entity_description in ROBOT_ENTITY_DESCRIPTIONS |
], | ||
update_before_add=True, | ||
) | ||
|
||
|
||
class ZcsMowerRobotVacuumEntity(ZcsMowerRobotEntity, StateVacuumEntity): | ||
class ZcsMowerVacuumEntity(ZcsMowerEntity, StateVacuumEntity): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
class ZcsMowerVacuumEntity(ZcsMowerEntity, StateVacuumEntity): | |
ZcsMowerRobotVacuumEntity(ZcsMowerRobotEntity, StateVacuumEntity): |
@@ -79,7 +74,7 @@ def __init__( | |||
self, | |||
hass: HomeAssistant, | |||
config_entry: ConfigEntry, | |||
coordinator: ZcsMowerDataUpdateCoordinator, | |||
coordinator: ZcsDataUpdateCoordinator, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
coordinator: ZcsDataUpdateCoordinator, | |
coordinator: ZcsMowerDataUpdateCoordinator, |
You seem to have used an older version of vacuum.py for your fix. Please merge your fix with the file from the main branch. |
I forked the main branch and then apply the fix. What shall I do now? Create a new PR? |
Fixing error:
2025-01-14 19:52:56.113 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_CLEANING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.CLEANING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.128 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_DOCKED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.DOCKED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.139 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_PAUSED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.PAUSED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.155 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_IDLE was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.IDLE instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.168 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_RETURNING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.RETURNING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.183 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_ERROR was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.ERROR instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.193 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_CLEANING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.CLEANING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.205 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_DOCKED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.DOCKED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.215 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_PAUSED was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.PAUSED instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.225 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_IDLE was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.IDLE instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.238 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_RETURNING was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.RETURNING instead, please report it to the author of the 'zcsmower' custom integration 2025-01-14 19:52:56.248 WARNING (ImportExecutor_0) [homeassistant.components.vacuum] STATE_ERROR was used from zcsmower, this is a deprecated constant which will be removed in HA Core 2026.1. Use VacuumActivity.ERROR instead, please report it to the author of the 'zcsmower' custom integration