Skip to content
Merged
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
.DS_Store
__pycache__/
.venv/
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.13.2
51 changes: 51 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Developing `connectlife-ha`

## Prerequisites

1. `uv`: https://docs.astral.sh/uv/getting-started/installation/
2. Home Assistant development environment: https://developers.home-assistant.io/docs/development_environment

Install the custom component in your Home Assistant development environment
(assuming your configuration directory is `config`):
```bash
home_assistant_repo=<local home-assistant repo>
connectlife_ha_repo=<local connectlife-ha repo>
cd ${home_assistant_repo}
mkdir -p config/custom_components
cd config/custom_components
ln -s ${connectlife_ha_repo}>/custom_componnents/connectlife .
```

Install dev dependencies (in `connectlife-ha` repo):
```bash
uv sync
```

## Generate `strings.json`

This will add strings for new properties.

```bash
uv run python -m scripts.gen_strings
```

## Validate mapping files

```bash
uv run python -m scripts.validate_mappings
```

## Use a test server

Clone https://github.com/oyvindwe/connectlife/

In your local `connectlife` repo:
```bash
python -m connectlife.test_server -d dumps
```

Configure the integration to access the test server:

![img.png](img.png)

![img_1.png](img_1.png)
4 changes: 2 additions & 2 deletions DEVICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
| WDSE1214-EVAJMW | Washing machine | 025 | 1wj120261v0w |
| WFSE1214-MVW002 | Washing machine | 025 | 1wj120389v0b |
| WF3S1114-LVW004 | Washing machine | 025 | 1wj105246v0w |
| | Washing machine | 026 | 1b0610z0049j |
| | Washing machine | 026 | 1b0628z0075j |
| | Refrigerator | 026 | 1b0610z0049j |
| | Refrigerator | 026 | 1b0628z0075j |
| RS818N4TIE1 | Refrigerator | 026 | 1b0628z0146j |
| WPNA84A2TSWIFI | Washing machine | 027 | washing-machine-wm22 |
| DH3S802BW3 | Tumble dryer | 030 | 1wk080066v0w |
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ To work around this issue, you can do the following:

Note that users at least in Russia and China can't log in using this integration. See discussion in
https://github.com/bilan/connectlife-api-connector/issues/25

## Contributing

See [DEVELOPMENT.md](DEVELOPMENT.md).
4 changes: 3 additions & 1 deletion custom_components/connectlife/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@ class InvalidAuth(HomeAssistantError):
class OptionsFlowHandler(OptionsFlow):
"""Handles options flow for the component."""

async def async_step_init(self, user_input=None):
_device_id: str | None = None

async def async_step_init(self, user_input=None) -> ConfigFlowResult:
return self.async_show_menu(
step_id="init",
menu_options=["select_device", "development"],
Expand Down
4 changes: 2 additions & 2 deletions custom_components/connectlife/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
SensorEntityDescription,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform, EntityCategory
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import ServiceValidationError
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers import config_validation as cv, entity_platform, service
from homeassistant.helpers import config_validation as cv, entity_platform

from .const import DOMAIN
from .coordinator import ConnectLifeCoordinator
Expand Down
Binary file added img.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[project]
name = "connectlife-ha"
version = "0.25.0"
description = "Custom Home Assistant component for ConnectLife devices"
readme = "README.md"
requires-python = ">=3.13.2"
dependencies = [
"connectlife==0.5.4",
]

[dependency-groups]
dev = [
"jschon==0.11.1",
"pyyaml>=6.0.3",
]
1 change: 0 additions & 1 deletion scripts/validate_mappings.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import json
import pprint
from os import listdir
from os.path import isfile, join
Expand Down
373 changes: 373 additions & 0 deletions uv.lock

Large diffs are not rendered by default.