mirror of
https://github.com/home-assistant/core.git
synced 2025-04-30 20:27:57 +00:00

* Add config flow to kodi * Fix lint errors * Remove entry update listener * Create test_init.py * Apply suggestions from code review Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Update __init__.py * fix indentation * Apply suggestions from code review * Apply suggestions from code review * Update tests/components/kodi/__init__.py * Fix init test * Fix merge * More review changes * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Chris Talkington <chris@talkingtontech.com> * Fix black formatting * Fix Flake8 * Don't store CONF_ID * Fall back to entry id * Apply suggestions from code review Co-authored-by: J. Nick Koston <nick@koston.org> * Update __init__.py * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Chris Talkington <chris@talkingtontech.com> Co-authored-by: J. Nick Koston <nick@koston.org>
68 lines
1.3 KiB
Python
68 lines
1.3 KiB
Python
"""Test the Kodi config flow."""
|
|
from homeassistant.components.kodi.const import DEFAULT_SSL
|
|
|
|
TEST_HOST = {
|
|
"host": "1.1.1.1",
|
|
"port": 8080,
|
|
"ssl": DEFAULT_SSL,
|
|
}
|
|
|
|
|
|
TEST_CREDENTIALS = {"username": "username", "password": "password"}
|
|
|
|
|
|
TEST_WS_PORT = {"ws_port": 9090}
|
|
|
|
UUID = "11111111-1111-1111-1111-111111111111"
|
|
TEST_DISCOVERY = {
|
|
"host": "1.1.1.1",
|
|
"port": 8080,
|
|
"hostname": "hostname.local.",
|
|
"type": "_xbmc-jsonrpc-h._tcp.local.",
|
|
"name": "hostname._xbmc-jsonrpc-h._tcp.local.",
|
|
"properties": {"uuid": UUID},
|
|
}
|
|
|
|
|
|
TEST_IMPORT = {
|
|
"name": "name",
|
|
"host": "1.1.1.1",
|
|
"port": 8080,
|
|
"ws_port": 9090,
|
|
"username": "username",
|
|
"password": "password",
|
|
"ssl": True,
|
|
"timeout": 7,
|
|
}
|
|
|
|
|
|
class MockConnection:
|
|
"""A mock kodi connection."""
|
|
|
|
def __init__(self, connected=True):
|
|
"""Mock the Kodi connection."""
|
|
self._connected = connected
|
|
|
|
async def connect(self):
|
|
"""Mock connect."""
|
|
pass
|
|
|
|
@property
|
|
def connected(self):
|
|
"""Mock connected."""
|
|
return self._connected
|
|
|
|
@property
|
|
def can_subscribe(self):
|
|
"""Mock can_subscribe."""
|
|
return False
|
|
|
|
async def close(self):
|
|
"""Mock close."""
|
|
pass
|
|
|
|
@property
|
|
def server(self):
|
|
"""Mock server."""
|
|
return None
|