* First commit * Feature complete? * Add dependency * Move setting poe mode logic to library * Use guard clauses * Bump requirement to 2 * Simplify saving switches with poe off * Store and use poe mode * Fix indentation * Fix flake8 * Configuration future proofing * Bump dependency to v3 * Add first test * Proper use of defaults with config flow (thanks helto) * Appease hound * Make sure there can't be duplicate entries of combination host+site * More tests * More tests * 98% coverage of controller * Fix hound comments * Config flow step init not necessary * Use async_current_entries to check if host and site for controller is used * Remove storing/restoring poe off devices to slim PR * First batch of switch tests * More switch tests. * Small improvements and clean up * Make tests pass Don't name device in device registry * Dont process clients that belong to non-UniFi POE switches * Allow selection of site from a list in config flow * Fix double blank lines in method * Update codeowners
26 lines
576 B
Python
26 lines
576 B
Python
"""Errors for the UniFi component."""
|
|
from homeassistant.exceptions import HomeAssistantError
|
|
|
|
|
|
class UnifiException(HomeAssistantError):
|
|
"""Base class for UniFi exceptions."""
|
|
|
|
|
|
class AlreadyConfigured(UnifiException):
|
|
"""Controller is already configured."""
|
|
|
|
|
|
class AuthenticationRequired(UnifiException):
|
|
"""Unknown error occurred."""
|
|
|
|
|
|
class CannotConnect(UnifiException):
|
|
"""Unable to connect to the controller."""
|
|
|
|
|
|
class LoginRequired(UnifiException):
|
|
"""Component got logged out."""
|
|
|
|
|
|
class UserLevel(UnifiException):
|
|
"""User level too low."""
|