{"id":23372965,"url":"https://github.com/mapleeve/lifesmart-for-homeassistant","last_synced_at":"2026-05-05T22:02:11.496Z","repository":{"id":232336168,"uuid":"784058408","full_name":"MapleEve/lifesmart-for-homeassistant","owner":"MapleEve","description":"HACS LifeSmart Integration","archived":false,"fork":false,"pushed_at":"2026-04-25T16:09:54.000Z","size":3705,"stargazers_count":34,"open_issues_count":23,"forks_count":9,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-04-25T18:16:13.554Z","etag":null,"topics":["hacs-integration","home-assistant","homeassistant","homeassistant-custom-component","lifesmart","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MapleEve.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-04-09T05:26:22.000Z","updated_at":"2026-04-17T23:39:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"a59de4fb-1175-4672-8664-29878b81e6ba","html_url":"https://github.com/MapleEve/lifesmart-for-homeassistant","commit_stats":null,"previous_names":["mapleeve/lifesmart-hacs-for-hass","mapleeve/lifesmart-for-homeassistant"],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/MapleEve/lifesmart-for-homeassistant","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapleEve%2Flifesmart-for-homeassistant","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapleEve%2Flifesmart-for-homeassistant/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapleEve%2Flifesmart-for-homeassistant/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapleEve%2Flifesmart-for-homeassistant/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MapleEve","download_url":"https://codeload.github.com/MapleEve/lifesmart-for-homeassistant/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapleEve%2Flifesmart-for-homeassistant/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32669433,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-05T11:29:49.557Z","status":"ssl_error","status_checked_at":"2026-05-05T11:29:48.587Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacs-integration","home-assistant","homeassistant","homeassistant-custom-component","lifesmart","python3"],"created_at":"2024-12-21T16:51:46.701Z","updated_at":"2026-05-05T22:02:11.485Z","avatar_url":"https://github.com/MapleEve.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LifeSmart IoT Integration for Home Assistant\n\n[![hacs_badge](https://img.shields.io/badge/HACS-Default-orange.svg)](https://github.com/hacs/integration)\n![GitHub License](https://img.shields.io/github/license/MapleEve/lifesmart-for-homeassistant)\n[![version](https://img.shields.io/github/manifest-json/v/MapleEve/lifesmart-for-homeassistant?filename=custom_components%2Flifesmart%2Fmanifest.json)](https://github.com/MapleEve/lifesmart-for-homeassistant/releases/latest)\n[![stars](https://img.shields.io/github/stars/MapleEve/lifesmart-for-homeassistant)](https://github.com/MapleEve/lifesmart-for-homeassistant/stargazers)\n[![issues](https://img.shields.io/github/issues/MapleEve/lifesmart-for-homeassistant)](https://github.com/MapleEve/lifesmart-for-homeassistant/issues)\n![haasfestworkflow](https://github.com/MapleEve/lifesmart-for-homeassistant/actions/workflows/haas-vali.yml/badge.svg)\n![hacsworkflow](https://github.com/MapleEve/lifesmart-for-homeassistant/actions/workflows/hacs-vali.yml/badge.svg)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMapleEve%2Flifesmart-for-homeassistant.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2FMapleEve%2Flifesmart-for-homeassistant?ref=badge_shield)\n\n\u003e 中文版可以查看 [中文说明](./README_CN.md).\n\n---\n\n## Overview\n\nLifeSmart for Home Assistant integrates LifeSmart smart home devices with Home Assistant. It supports both Cloud and\nLocal modes, automatic device discovery, and advanced automation via Home Assistant services. The integration supports a\nwide range of LifeSmart devices, including switches, sensors, locks, controllers, SPOT devices, and cameras.\nInstallation and updates are available via HACS.\n\n---\n\n## Features\n\n- **Dual Connection Modes**: Cloud and Local modes (choose between LifeSmart API or local Hub)\n- **Comprehensive Device Support**: Switches, sensors, locks, controllers, sockets, curtain motors, lights, SPOT,\n  cameras\n- **Advanced Services**: Send IR keys (including A/C), trigger LifeSmart scenes, momentary switch press\n- **Multi-region Support**: China, North America, Europe, Japan, Asia Pacific, Global Auto\n- **Bilingual Interface**: English/Chinese UI support\n- **Robust Testing**: 704+ comprehensive tests ensuring reliability\n- **Version Compatibility**: Home Assistant 2023.6.3+ with automated compatibility layers\n\n### Recent Major Improvements (May 2026)\n\nFor detailed release notes and issue handling notes, see [CHANGELOG.md](./CHANGELOG.md).\n\n- **📦 2026.05 main/current patch preparation**: Documentation is prepared for the pending `v2026.05.1` patch candidate, and the manifest version has been bumped to `v2026.05.1` for the next main/current release.\n- **☁️ Cloud Authentication**: Improved password-login handling by using the region returned by the LifeSmart auth flow and preserving returned token/user/region data.\n- **🏠 Local Protocol Robustness**: Hardened local protocol decoding for nested packets that previously could raise `TypeError: unhashable type: 'dict'`.\n- **💡 Device Feedback Fixes**: Added runtime aliases for `SL_SC_BG_V1` and `SL_P_V1`, restored single-IO RGBW light creation, improved SPOT light state mapping, corrected DOOYA curtain direction/position updates, and improved climate partial-state merging.\n- **⚠️ Scope Note**: Gen2 / `v25.08.1` architecture work is not included in this main/current release line.\n- **🔧 Compatibility Layer**: Added comprehensive compatibility support for Home Assistant versions 2023.6.3 to 2026.05+\n- **🧪 Enhanced Testing**: Completely rewritten compatibility tests with 14 dedicated test cases\n- **🏗️ Code Architecture**: Major refactoring - unified client interfaces, split local/OAPI\n  clients ([#66](https://github.com/MapleEve/lifesmart-HACS-for-hass/pull/66))\n- **🐛 Bug Fixes**: Fixed OAPI scene activation and deletion by\n  name ([#73](https://github.com/MapleEve/lifesmart-HACS-for-hass/pull/73))\n- **🐛 Local Mode Fixes**: Fixed device state updates in Local\n  Mode ([#65](https://github.com/MapleEve/lifesmart-HACS-for-hass/pull/65))\n- **⚡ Performance**: Replaced lists with sets for faster\n  lookups ([#55](https://github.com/MapleEve/lifesmart-HACS-for-hass/pull/55))\n- **🛠️ Developer Experience**: Added comprehensive PR templates and automated PR summaries\n- **📊 Code Quality**: Integrated Black code formatter and Flake8 linting with line-length 88\n- **🏷️ License Compliance**: Added FOSSA license scanning and\n  badges ([#60](https://github.com/MapleEve/lifesmart-HACS-for-hass/pull/60))\n\n---\n\n## Installation\n\n### Install via HACS\n\n1. In Home Assistant, go to HACS \u003e Integrations \u003e Search for \"LifeSmart for Home Assistant\".\n2. Click \"Install\".\n3. After installation, click \"Add Integration\" and search for \"LifeSmart\".\n\n[![Add via HACS](https://my.home-assistant.io/badges/hacs_repository.svg)](https://my.home-assistant.io/redirect/hacs_repository/?owner=MapleEve\u0026repository=lifesmart-for-homeassistant\u0026category=integration)\n[![Add Integration](https://my.home-assistant.io/badges/config_flow_start.svg)](https://my.home-assistant.io/redirect/config_flow_start?domain=lifesmart)\n\n---\n\n## Initialization\n\n### Prerequisites\n\n- Cloud mode: Register a new application on the [LifeSmart Open Platform](http://www.ilifesmart.com/open/login) to\n  obtain your App Key and App Token. Log in to the LifeSmart mobile app to get your User ID.\n- Local mode: Obtain your LifeSmart Hub's local IP, port (default 8888), username (default admin), and password (default\n  admin).\n\n### Setup Steps\n\n#### Cloud Mode\n\n1. Select \"Cloud\" as the connection method.\n2. Enter your App Key, App Token, User ID, select your region, and choose authentication (token or password).\n3. If using password authentication, enter your LifeSmart app password to allow Home Assistant to refresh your token\n   automatically.\n\n#### Local Mode\n\n1. Select \"Local\" as the connection method.\n2. Enter your Hub's IP address, port (default 8888), username (default admin), and password (default admin).\n\n---\n\n## Usage\n\n### Home Assistant Services\n\n- Send IR Keys: Send IR commands to remote devices (e.g., TVs, A/Cs).\n- Send A/C Keys: Send IR commands with power, mode, temperature, wind, and swing options to air conditioners.\n- Trigger Scene: Activate a LifeSmart scene by specifying the hub and scene ID.\n- Press Switch: Perform a momentary press on a switch entity for a specified duration.\n\nExample service call (YAML):\n\n```yaml\nservice: lifesmart.send_ir_keys\ndata:\n  agt: \"_xXXXXXXXXXXXXXXXXX\"\n  me: \"sl_spot_xxxxxxxx\"\n  ai: \"AI_IR_xxxx_xxxxxxxx\"\n  category: \"tv\"\n  brand: \"custom\"\n  keys: [ \"power\" ]\n```\n\n---\n\n## Supported Devices\n\nSupports a wide range of LifeSmart devices, including but not limited to:\n\nSwitches: SL_MC_ND1, SL_MC_ND2, SL_MC_ND3, SL_NATURE, SL_P_SW, SL_S, SL_SF_IF1, SL_SF_IF2, SL_SF_IF3, SL_SF_RC, SL_SPWM,\nSL_SW_CP1, SL_SW_CP2, SL_SW_CP3, SL_SW_DM1, SL_SW_FE1, SL_SW_FE2, SL_SW_IF1, SL_SW_IF2, SL_SW_IF3, SL_SW_MJ1, SL_SW_MJ2,\nSL_SW_MJ3, SL_SW_ND1, SL_SW_ND2, SL_SW_ND3, SL_SW_RC, SL_SW_RC1, SL_SW_RC2, SL_SW_RC3, SL_SW_NS1, SL_SW_NS2, SL_SW_NS3,\nV_IND_S\n\nLocks: SL_LK_LS, SL_LK_GTM, SL_LK_AG, SL_LK_SG, SL_LK_YL, SL_P_BDLK, OD_JIUWANLI_LOCK1\n\nControllers: SL_P, SL_JEMA\n\nSockets/Plugs: SL_OE_DE, SL_OE_3C, SL_OL_W, OD_WE_OT1, SL_OL, SL_OL_3C, SL_OL_DE, SL_OL_UK, SL_OL_UL\n\nCurtain Motors: SL_SW_WIN, SL_CN_IF, SL_CN_FE, SL_DOOYA, SL_P_V2\n\nLights: SL_LI_RGBW, SL_CT_RGBW, SL_SC_RGB, OD_WE_QUAN, SL_LI_WW, SL_LI_GD1, SL_LI_UG1, MSL_IRCTL, OD_WE_IRCTL, SL_SPOT,\nSL_P_IR\n\nSensors: SL_SC_G, SL_SC_BG, SL_SC_MHW, SL_SC_CM, SL_SC_BM, SL_P_RM, SL_SC_THL, SL_SC_BE, SL_SC_CQ, SL_SC_CA, SL_SC_B1,\nSL_SC_WA, SL_SC_CH, SL_SC_CP, ELIQ_EM, SL_P_A, SL_DF_GG, SL_DF_MM, SL_DF_SR, SL_DF_BB, SL_SC_CN\n\nSPOT Devices: MSL_IRCTL, OD_WE_IRCTL, SL_SPOT, SL_P_IR, SL_P_IR_V2\n\nCameras: LSCAM:LSICAMGOS1, LSCAM:LSICAMEZ2\n\nFor a full and up-to-date list, see\nthe [supported devices section in the codebase](https://github.com/MapleEve/lifesmart-for-homeassistant/blob/main/custom_components/lifesmart/const.py).\n\n---\n\n## Compatibility \u0026 Testing\n\n### Home Assistant Version Support\n\nThis integration is thoroughly tested across multiple Home Assistant versions using conda environments:\n\n| Environment       | Python  | Home Assistant | pytest | pytest-ha-custom | aiohttp | Test Status         |\n|-------------------|---------|----------------|--------|------------------|---------|---------------------|\n| **Environment 1** | 3.11.13 | **2023.6.0**   | 7.3.1  | 0.13.36          | 3.8.4   | ✅ **704/704 tests** |\n| **Environment 2** | 3.12.11 | **2024.2.0**   | 7.4.4  | 0.13.99          | 3.9.3   | ✅ **704/704 tests** |\n| **Environment 3** | 3.13.5  | **2024.12.0**  | 8.3.3  | 0.13.190         | 3.11.9  | ✅ **704/704 tests** |\n| **Current**       | 3.13.5  | **2026.05** | 8.4.1  | 0.13.266         | 3.12.15 | ✅ **704/704 tests** |\n\n### Test Infrastructure\n\n- **Conda Environments**: Pre-configured conda environments for each HA version\n- **Automated Testing**: Local CI script (`.testing/test_ci_locally.sh`) with interactive interface\n- **Comprehensive Coverage**: 704+ unit tests with 14 dedicated compatibility tests\n- **CI/CD Pipeline**: Automated testing across multiple Python and Home Assistant versions\n\n### Compatibility Features\n\n- **Automatic Version Detection**: Seamlessly adapts to different Home Assistant and aiohttp versions\n- **WebSocket Timeout Handling**: Supports both legacy float timeouts and modern ClientWSTimeout objects\n- **Climate Entity Features**: Provides backward compatibility for TURN_ON/TURN_OFF attributes\n- **Service Call Compatibility**: Handles both legacy and modern Home Assistant service call constructors\n\n### Code Quality Standards\n\n- **Black Code Formatting**: Consistent code style with 88 character line length\n- **Flake8 Linting**: Comprehensive code quality checks\n- **Comprehensive Testing**: 667+ unit tests with 14 dedicated compatibility tests\n- **CI/CD Pipeline**: Automated testing across multiple Python and Home Assistant versions\n\n---\n\n## Development \u0026 Contributing\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/MapleEve/lifesmart-HACS-for-hass.git\ncd lifesmart-HACS-for-hass\n\n# Set up conda environments for testing (recommended)\n# Install conda/anaconda first, then create test environments:\nconda create -n ci-test-ha2023.6.0-py3.11 python=3.11\nconda create -n ci-test-ha2024.2.0-py3.12 python=3.12\nconda create -n ci-test-ha2024.12.0-py3.13 python=3.13\nconda create -n ci-test-ha-latest-py3.13 python=3.13\n\n# Install dependencies for each environment (example for HA 2023.6.0):\nconda activate ci-test-ha2023.6.0-py3.11\npip install \"pytest\u003e=7.2.1,\u003c8.0.0\" \"pytest-homeassistant-custom-component==0.13.36\"\npip install pytest-asyncio pytest-cov flake8 black\n\n# Or use traditional venv setup\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\npip install -r requirements.txt\npip install black flake8 pytest\n```\n\n### Testing\n\nThe project uses a comprehensive testing script that works with conda environments:\n\n```bash\n# Run the interactive testing script\n./.testing/test_ci_locally.sh\n\n# Available options:\n# 1) ci-test-ha2023.6.0-py3.11  (HA 2023.6.0 + Python 3.11)\n# 2) ci-test-ha2024.2.0-py3.12  (HA 2024.2.0 + Python 3.12)  \n# 3) ci-test-ha2024.12.0-py3.13 (HA 2024.12.0 + Python 3.13)\n# 4) ci-test-ha-latest-py3.13   (HA latest + Python 3.13)\n# 5) Full CI matrix test (all environments)\n\n# Run tests in specific environment\nconda activate ci-test-ha2023.6.0-py3.11\n./.testing/test_ci_locally.sh --current\n\n# Run tests for all environments\n./.testing/test_ci_locally.sh --all\n```\n\n### Code Quality\n\n```bash\n# Format code with Black (line length 88)\nblack custom_components/lifesmart/ --line-length 88\n\n# Run linting\nflake8 custom_components/lifesmart/\n\n# Run tests\npytest custom_components/lifesmart/tests/\n\n# Format code\nblack custom_components/lifesmart/\n\n# Check code quality\nflake8 custom_components/lifesmart/\n```\n\n### Contributing Guidelines\n\n- Follow the existing code style (Black formatting, 88 char lines)\n- Add comprehensive tests for new features\n- Update documentation for user-facing changes\n- Use conventional commit messages\n- Reference relevant issues in pull requests\n\nFor detailed contributing guidelines, see our [PR template](.github/PULL_REQUEST_TEMPLATE.md).\n\n---\n\n## Diagrams\n\n**Example Configuration Screenshots**\n\n![Example Configuration](./docs/example-configuration.png)\n![Example Image](./docs/example-image.png)\n![Example Image 2](./docs/example-image-2.png)\n![Example Image 3](./docs/example-image-3.png)\n![Example Image 4](./docs/example-image-4.png)\n\n## License\n\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2FMapleEve%2Flifesmart-for-homeassistant.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2FMapleEve%2Flifesmart-for-homeassistant?ref=badge_large)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapleeve%2Flifesmart-for-homeassistant","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapleeve%2Flifesmart-for-homeassistant","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapleeve%2Flifesmart-for-homeassistant/lists"}