Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@ on:
- "**/CHANGELOG.md"
- "**/CONTRIBUTING.md"
- "**/requirements.txt"
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
ruff:
Expand All @@ -25,7 +21,7 @@ jobs:
- name: "Set up Python"
uses: actions/setup-python@v5.1.0
with:
python-version: "3.11"
python-version: "3.14"
cache: "pip"

- name: "Install requirements"
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ on:
- "**/CHANGELOG.md"
- "**/CONTRIBUTING.md"
- "**/requirements.txt"
branches:
- "main"
pull_request:
branches:
- "main"

jobs:
hassfest: # https://developers.home-assistant.io/blog/2020/04/16/hassfest
Expand Down
11 changes: 6 additions & 5 deletions .ruff.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# The contents of this file is based on https://github.com/home-assistant/core/blob/dev/pyproject.toml

target-version = "py310"
target-version = "py313"

[lint]
select = [
"B007", # Loop control variable {name} not used within loop body
"B014", # Exception handler with duplicate exception
Expand Down Expand Up @@ -38,11 +39,11 @@ ignore = [
"E731", # do not assign a lambda expression, use a def
]

[flake8-pytest-style]
[lint.flake8-pytest-style]
fixture-parentheses = false

[pyupgrade]
[lint.pyupgrade]
keep-runtime-typing = true

[mccabe]
max-complexity = 25
[lint.mccabe]
max-complexity = 25
16 changes: 6 additions & 10 deletions custom_components/securityspy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
CONF_PASSWORD,
)
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.exceptions import ConfigEntryNotReady, ServiceValidationError
from homeassistant.exceptions import (
ConfigEntryAuthFailed,
ConfigEntryNotReady,
ServiceValidationError,
)
from homeassistant.helpers.aiohttp_client import async_create_clientsession
from homeassistant.helpers.typing import ConfigType
import homeassistant.helpers.device_registry as dr
Expand Down Expand Up @@ -92,8 +96,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
try:
server_info = await securityspyserver.get_server_information()
except InvalidCredentials as unauthex:
_LOGGER.error("Could not authorize against SecuritySpy. Error: %s.", unauthex)
return False
raise ConfigEntryAuthFailed from unauthex
except (RequestError, ServerDisconnectedError) as notreadyerror:
raise ConfigEntryNotReady from notreadyerror

Expand All @@ -111,8 +114,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
if not secspy_data.last_update_success:
raise ConfigEntryNotReady

entry.async_on_unload(entry.add_update_listener(_async_options_updated))

entry.runtime_data = SecuritySpyRuntimeData(
secspy_data=secspy_data,
nvr=securityspyserver,
Expand Down Expand Up @@ -173,11 +174,6 @@ async def async_handle_enable_schedule_preset(hass: HomeAssistant, call: Service
await runtime_entries[0].nvr.enable_schedule_preset(preset_id)


async def _async_options_updated(hass: HomeAssistant, entry: ConfigEntry):
"""Update options."""
await hass.config_entries.async_reload(entry.entry_id)


async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload SecuritySpy config entry."""
unload_ok = await hass.config_entries.async_unload_platforms(
Expand Down
8 changes: 2 additions & 6 deletions custom_components/securityspy/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class SecuritySpyFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
@callback
def async_get_options_flow(config_entry):
"""Get the options flow for this handler."""
return OptionsFlowHandler(config_entry)
return OptionsFlowHandler()

async def async_step_user(self, user_input=None):
"""Handle a flow initiated by the user."""
Expand Down Expand Up @@ -118,13 +118,9 @@ async def _show_setup_form(self, errors=None):
)


class OptionsFlowHandler(config_entries.OptionsFlow):
class OptionsFlowHandler(config_entries.OptionsFlowWithReload):
"""Handle options."""

def __init__(self, config_entry):
"""Initialize options flow."""
self.config_entry = config_entry

async def async_step_init(self, user_input=None):
"""Manage the options."""
if user_input is not None:
Expand Down
10 changes: 6 additions & 4 deletions custom_components/securityspy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
"domain": "securityspy",
"name": "SecuritySpy for Home Assistant",
"codeowners": [
"@briis"
"@briis",
"@dr-apple"
],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/briis/securityspy",
"documentation": "https://github.com/dr-apple/securityspy",
"integration_type": "hub",
"iot_class": "local_push",
"issue_tracker": "https://github.com/briis/securityspy/issues",
"issue_tracker": "https://github.com/dr-apple/securityspy/issues",
"requirements": [
"pysecspy==1.3.5"
],
"version": "1.2.0"
"version": "1.2.1"
}
2 changes: 1 addition & 1 deletion hacs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "SecuritySpy for Home Assistant",
"homeassistant": "2025.12.0"
"homeassistant": "2026.8.0"
}
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
colorlog==6.8.2
homeassistant>=2025.12.0
pip>=23.2.1,<24.3
ruff==0.11.13
homeassistant==2026.8.1
ruff==0.16.2
Loading