Add config flow to HLK-SW16 (#37190)
* Add config flow to HLK-SW16 * Use entry_id for unique_id * Add options update capability * Refactor entry_id under domain * Remove name from config * Set options * Remove options flow * remove unneccesary else block from validate_input and move domain cleanup to async_unload_entry * Add tests and config import * Add back config schema * Remove config import * Refactor unload * Add back config import * Update coveragerc * Don't mock validate_input * Test duplicate configs * Add import test * Use patch for timeout test * Use mock for testing timeout * Use MockSW16Client for tests * Check mock_calls count * Remove unused NameExists exception * Remove title from strings.json * Mock setup for import test * Set PARALLEL_UPDATES for switch * Move hass.data.setdefault(DOMAIN, {}) to async_setup_entry
This commit is contained in:
parent
76b46b9175
commit
064cc52ad6
14 changed files with 482 additions and 90 deletions
9
homeassistant/components/hlk_sw16/const.py
Normal file
9
homeassistant/components/hlk_sw16/const.py
Normal file
|
@ -0,0 +1,9 @@
|
|||
"""Constants for HLK-SW16 component."""
|
||||
|
||||
DOMAIN = "hlk_sw16"
|
||||
|
||||
DEFAULT_NAME = "HLK-SW16"
|
||||
DEFAULT_PORT = 8080
|
||||
DEFAULT_RECONNECT_INTERVAL = 10
|
||||
DEFAULT_KEEP_ALIVE_INTERVAL = 3
|
||||
CONNECTION_TIMEOUT = 10
|
Loading…
Add table
Add a link
Reference in a new issue