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

Fix for 2024.06.0 #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Xiaomi Viomi vacuum robot integration for Home Assistant.

## Installation
### HACS
Install it through HACS by adding this as a custom repository: https://github.com/rakuuhwa/homeassistant-vacuum-viomi, go to the integrations page in your configuration, click on the `Add Integration` button in the bottom right corner of a screen, and search for `Xiaomi Viomi Vacuum`.
Install it through HACS by adding this as a custom repository: https://github.com/jmcrfp/homeassistant-vacuum-viomi, go to the integrations page in your configuration, click on the `Add Integration` button in the bottom right corner of a screen, and search for `Xiaomi Viomi Vacuum`.

### Manual
Copy contents of `custom_components` folder to your Home Assistant `config/custom_components` folder. Restart Home Assistant, and then the integration can be added and configured through the native integration setup. If you don't see it in the native integrations list, press Ctrl+F5 to refresh the browser while you're on that page and retry.
Expand Down
2 changes: 2 additions & 0 deletions custom_components/xiaomi_viomi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
CONF_NAME,
CONF_PLATFORM,
CONF_TOKEN,
CONF_UNIQUE_ID,
DEVICE_DEFAULT_NAME,
)
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -94,6 +95,7 @@ async def validate_input(hass: HomeAssistant, data: Dict[str, Any]) -> Dict[str,
CONF_TOKEN: data[CONF_TOKEN],
CONF_MODEL: hub.device_info.model,
CONF_NAME: name,
CONF_UNIQUE_ID: format_mac(hub.device_info.mac_address),
CONF_MAC: format_mac(hub.device_info.mac_address),
}

Expand Down
6 changes: 3 additions & 3 deletions custom_components/xiaomi_viomi/manifest.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"codeowners": ["@rakuuhwa"],
"codeowners": ["@jmcrfp"],
"config_flow": true,
"dependencies": ["xiaomi_miio"],
"documentation": "https://github.com/rakuuhwa/homeassistant-vacuum-viomi",
"documentation": "https://github.com/jmcrfp/homeassistant-vacuum-viomi",
"domain": "xiaomi_viomi",
"iot_class": "local_polling",
"issue_tracker": "https://github.com/rakuuhwa/homeassistant-vacuum-viomi/issues",
"issue_tracker": "https://github.com/jmcrfp/homeassistant-vacuum-viomi/issues",
"name": "Xiaomi Viomi Vaccum",
"requirements": [
"construct>=2.10.67",
Expand Down
8 changes: 6 additions & 2 deletions custom_components/xiaomi_viomi/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
from homeassistant.components.vacuum import DOMAIN as PLATFORM_NAME
from homeassistant.components.vacuum import STATE_ERROR, StateVacuumEntity
from homeassistant.components.xiaomi_miio import CONF_MODEL
from homeassistant.components.xiaomi_miio.device import XiaomiMiioEntity
from homeassistant.components.xiaomi_miio.entity import XiaomiMiioEntity
from homeassistant.config_entries import SOURCE_USER, ConfigEntry
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_TOKEN, STATE_OFF, STATE_ON
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_TOKEN, STATE_OFF, STATE_ON, CONF_UNIQUE_ID
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
Expand Down Expand Up @@ -56,8 +56,12 @@ async def async_setup_platform(
domain=PLATFORM_NAME,
data=config,
version=2,
minor_version=1,
unique_id=config[CONF_UNIQUE_ID],
options={},
title=config[CONF_NAME],
source=SOURCE_USER,
discovery_keys=(),
)
await async_setup_entry(hass, entry, async_add_entities)

Expand Down