For running tests and development (the tests need Linux or WSL, they do not run on Windows):
pip install -r requirements-dev.txt
Run tests with:
pytest tests/
Run tests with coverage:
pytest --cov=custom_components.syr_connect --cov-report=term-missing tests/
For testing without a real SYR device, use the SYR Connect Emulator:
Repository: https://github.com/alexhass/syr_connect_emulator
The emulator provides:
To use the emulator and install to Apache:
Clone the emulator:
git clone https://github.com/alexhass/syr_connect_emulator.git
The emulator responds to all standard API calls and allows testing features without accessing real devices.
The following packages will be automatically installed by Home Assistant:
pycryptodomex (not pycryptodome) to avoid conflicts with Home Assistant’s crypto librariesxml.etree.ElementTree with a hardened versionAfter installing the integration in Home Assistant:
ModuleNotFoundError or ImportErrorModuleNotFoundError: No module named 'Cryptodome' or No module named 'defusedxml'Solution: Restart Home Assistant to trigger automatic installation of required packages (pycryptodomex and defusedxml)
ImportError: cannot import name 'AES' from 'Crypto.Cipher'Solution: This indicates a conflict with the old pycryptodome package. The integration now uses pycryptodomex which avoids this conflict.
Solution:
config/custom_components/syr_connect/If automatic installation fails, you can manually install the dependencies:
# For Home Assistant Container/OS
docker exec -it homeassistant pip install "pycryptodomex>=3.19.0,<4.0" "defusedxml>=0.7.1,<1.0"
# For Home Assistant Core
source /srv/homeassistant/bin/activate
pip install "pycryptodomex>=3.19.0,<4.0" "defusedxml>=0.7.1,<1.0"
config/
└── custom_components/
└── syr_connect/
├── __init__.py
├── manifest.json
├── aiosyrconnect/
│ ├── __init__.py
│ ├── codes.py
│ ├── commands.py
│ ├── const.py
│ ├── exceptions.py
│ ├── http_client.py
│ ├── json_api.py
│ ├── model_detection.py
│ ├── models.py
│ ├── py.typed
│ ├── settings.py
│ ├── units.py
│ ├── values.py
│ ├── xml_api.py
│ ├── xml_checksum.py
│ ├── xml_encryption.py
│ ├── xml_parser.py
│ └── xml_payload.py
├── config_flow.py
├── const.py
├── models.py
├── coordinator.py
├── data.py
├── sensor.py
├── binary_sensor.py
├── button.py
├── select.py
├── switch.py
├── update.py
├── valve.py
├── diagnostics.py
├── entity.py
├── helpers/
│ ├── __init__.py
│ ├── device.py
│ ├── integration.py
│ ├── profile.py
│ └── registry.py
├── icons.json
├── migrations.py
├── devices/
│ ├── __init__.py
│ └── <one file per device family>.py
├── brand/
│ ├── icon.png
│ ├── icon@2x.png
│ ├── logo.png
│ └── logo@2x.png
└── translations/
├── de.json
├── en.json
├── es.json
├── fr.json
├── it.json
├── nl.json
├── pl.json
└── pt.json
All files must be present for the integration to work correctly.