-
-
Notifications
You must be signed in to change notification settings - Fork 145
Open
Labels
Description
Checklist
- I have updated the integration to the latest version available
- I have checked if the vacuum/platform is already requested
- I have sent raw map file to
piotr.machowski.dev [at] gmail.com
(Retrieving map; please provide your GitHub username in the email)
What vacuum model do you want to be supported?
zhimi.vacuum.wa1
What is its name?
Pioneer A1
Available APIs
- xiaomi
- viomi
- roidmi
- dreame
Errors shown in the HA logs (if applicable)
Other info
Could you update vacuum_v2.py as follow so it will be compatible with Pioneer A1 👍
from typing import Optional
from custom_components.xiaomi_cloud_map_extractor.common.vacuum import XiaomiCloudVacuum
from custom_components.xiaomi_cloud_map_extractor.common.xiaomi_cloud_connector import XiaomiCloudConnector
class XiaomiCloudVacuumV2(XiaomiCloudVacuum):
def __init__(self, connector: XiaomiCloudConnector, country: str, user_id: str, device_id: str, model: str):
super().__init__(connector, country, user_id, device_id, model)
def get_map_url(self, map_name: str) -> Optional[str]:
url = self._connector.get_api_url(self._country) + '/v2/home/get_interim_file_url'
if self.model == 'zhimi.vacuum.wa1':
url += '_pro'
params = {
"data": f'{{"obj_name":"{self._user_id}/{self._device_id}/{map_name}"}}'
}
api_response = self._connector.execute_api_call_encrypted(url, params)
if api_response is None or "result" not in api_response or "url" not in api_response["result"]:
return None
return api_response["result"]["url"]
def should_get_map_from_vacuum(self) -> bool:
return False