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

Some fixes since latest HA breaking changes (#6) #2

Open
wants to merge 15 commits into
base: master
Choose a base branch
from
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# home-assistant-qubino-wire-pilot
# Home Assistant Component for Qubino Wire Pilot

Home Assistant Component for Qubino Wire Pilot

![CleanShot 2024-09-04 at 12 36 52](https://github.com/user-attachments/assets/0b2f4bc7-35c6-43e4-9050-02696c9f1b9f)

## Introduction

The Qubino ZMNHJD1 is not recognized as a thermostat in Home Assistant but as a light.
The light percentage is mapped to a mode.
The Qubino ZMNHJD1 is not recognized as a thermostat in Home Assistant but as a light.

The brightness percentage of the light entity is mapped to a mode.

| Value | Min | Max |
| :--------------- | :-- | :--- |
Expand All @@ -16,7 +19,7 @@ The light percentage is mapped to a mode.
| Comfort -1 | 41% | 50% |
| Comfort | 51% | 100% |

This component create a `climate` entity using the `light` entity.
This integrtion create an `climate` entity using the `light` entity for easy control of your heater.

The climate will have 2 modes :

Expand All @@ -30,7 +33,13 @@ The climate will have 2 modes :

:warning: "Comfort -1" and "Comfort -2" are not available by default because home assistant doesn't have comfort-1 and comfort-2 preset. If you want to support these modes, add `additional_modes: true` in your configuration.

## Configuration
## Installation

You can convert the `light` to a `climate` entity by searching "Qubino Wire Pilot" in the integration page or helper page.

## YAML configuration

If you prefer to use `yaml`, you can, but it's not recommended as more and more integrations are moved to the UI. All the options are available in the UI.

| Key | Type | Required | Description |
| :----------------- | :------ | :------- | :------------------------------------------------------------------------------------------------------------------------ |
Expand All @@ -43,7 +52,7 @@ The climate will have 2 modes :

The unique id is recommended to allow icon, entity_id or name changes from the UI.

## Example
### Example

```yaml
climate:
Expand All @@ -69,7 +78,7 @@ climate:
sensor: sensor.temperature_living_room
```

## Unique ID
### Unique ID

The `unique_id` is used to edit the entity from the GUI. It's automatically generated from heater entity_id. As the `unique_id` must be unique, you can not create 2 entities with the same heater.

Expand Down
36 changes: 35 additions & 1 deletion custom_components/qubino_wire_pilot/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
"""Qubino wire pilot platform configuration"""
"""Qubino wire pilot component."""

from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers.device import (
async_remove_stale_devices_links_keep_entity_device,
)

CONF_HEATER = "heater"
DOMAIN = "qubino_wire_pilot"
PLATFORMS = [Platform.CLIMATE]


async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up from a config entry."""

async_remove_stale_devices_links_keep_entity_device(
hass,
entry.entry_id,
entry.options[CONF_HEATER],
)
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
entry.async_on_unload(entry.add_update_listener(config_entry_update_listener))
return True


async def config_entry_update_listener(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Update listener, called when the config entry options are changed."""
await hass.config_entries.async_reload(entry.entry_id)


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
Loading