From d974fda2cbd294c8d62910980a74101c774e612c Mon Sep 17 00:00:00 2001 From: Jordan Harvey Date: Fri, 8 Nov 2024 16:51:48 +0000 Subject: [PATCH] bump depandancies --- .devcontainer.json | 76 +++++++++---------- custom_components/family_safety/const.py | 3 +- .../family_safety/entity_base.py | 10 ++- custom_components/family_safety/manifest.json | 2 +- requirements.txt | 2 +- 5 files changed, 47 insertions(+), 46 deletions(-) diff --git a/.devcontainer.json b/.devcontainer.json index d26ac54..7d08b67 100644 --- a/.devcontainer.json +++ b/.devcontainer.json @@ -1,42 +1,40 @@ { - "name": "pantherale0/ha-familysafety", - "image": "mcr.microsoft.com/vscode/devcontainers/python:0-3.10-bullseye", - "postCreateCommand": "scripts/setup", - "forwardPorts": [ - 8123 - ], - "portsAttributes": { - "8123": { - "label": "Home Assistant", - "onAutoForward": "notify" - } - }, - "customizations": { - "vscode": { - "extensions": [ - "ms-python.python", - "github.vscode-pull-request-github", - "ryanluker.vscode-coverage-gutters", - "ms-python.vscode-pylance" - ], - "settings": { - "files.eol": "\n", - "editor.tabSize": 4, - "python.pythonPath": "/usr/bin/python3", - "python.analysis.autoSearchPaths": false, - "python.linting.pylintEnabled": true, - "python.linting.enabled": true, - "python.formatting.provider": "black", - "python.formatting.blackPath": "/usr/local/py-utils/bin/black", - "editor.formatOnPaste": false, - "editor.formatOnSave": true, - "editor.formatOnType": true, - "files.trimTrailingWhitespace": true - } - } - }, - "remoteUser": "vscode", - "features": { - "ghcr.io/devcontainers/features/rust:1": {} + "name": "pantherale0/ha-familysafety", + "image": "mcr.microsoft.com/devcontainers/python:3.12", + "postCreateCommand": "scripts/setup", + "forwardPorts": [8123], + "portsAttributes": { + "8123": { + "label": "Home Assistant", + "onAutoForward": "notify" } + }, + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "github.vscode-pull-request-github", + "ryanluker.vscode-coverage-gutters", + "ms-python.vscode-pylance" + ], + "settings": { + "files.eol": "\n", + "editor.tabSize": 4, + "python.pythonPath": "/usr/bin/python3", + "python.analysis.autoSearchPaths": false, + "python.linting.pylintEnabled": true, + "python.linting.enabled": true, + "python.formatting.provider": "black", + "python.formatting.blackPath": "/usr/local/py-utils/bin/black", + "editor.formatOnPaste": false, + "editor.formatOnSave": true, + "editor.formatOnType": true, + "files.trimTrailingWhitespace": true + } + } + }, + "remoteUser": "vscode", + "features": { + "ghcr.io/devcontainers/features/rust:1": {} + } } diff --git a/custom_components/family_safety/const.py b/custom_components/family_safety/const.py index 4d5725b..1f8b777 100644 --- a/custom_components/family_safety/const.py +++ b/custom_components/family_safety/const.py @@ -10,8 +10,7 @@ DEFAULT_OVERRIDE_ENTITIES = [ OverrideTarget.MOBILE, OverrideTarget.WINDOWS, - OverrideTarget.XBOX, - OverrideTarget.ALL_DEVICES, + OverrideTarget.XBOX ] AGG_TITLE = "Aggregator error occured. " AGG_HELP = "This is an upstream issue with Microsoft and is usually temporary. " diff --git a/custom_components/family_safety/entity_base.py b/custom_components/family_safety/entity_base.py index f1ddd38..7fc1dcb 100644 --- a/custom_components/family_safety/entity_base.py +++ b/custom_components/family_safety/entity_base.py @@ -17,6 +17,7 @@ _LOGGER = logging.getLogger(__name__) + class ManagedAccountEntity(CoordinatorEntity, Entity): """Base class for all managed account entities.""" @@ -59,6 +60,7 @@ async def async_unblock_application(self, name: str): """Blocks a application with a given app name.""" await [a for a in self._account.applications if a.name == name][0].unblock_app() + class ApplicationEntity(ManagedAccountEntity): """Define a application entity.""" @@ -68,7 +70,8 @@ def __init__(self, account_id, app_id: str) -> None: """Create a application entity.""" - super().__init__(coordinator, idx, account_id, f"override_{str(app_id).lower()}") + super().__init__(coordinator, idx, account_id, + f"override_{str(app_id).lower()}") self._app_id = app_id @property @@ -91,14 +94,15 @@ def __init__(self, account_id, platform: OverrideTarget) -> None: """Create a PlatformOverride entity.""" - super().__init__(coordinator, idx, account_id, f"override_{str(platform).lower()}") + super().__init__(coordinator, idx, account_id, + f"override_{str(platform).lower()}") self._platform = platform @property def _get_override_state(self) -> bool: """Get the current state if the override is active or not.""" for override in self._account.blocked_platforms: - if override == self._platform or override == OverrideTarget.ALL_DEVICES: + if override == self._platform: return True return False diff --git a/custom_components/family_safety/manifest.json b/custom_components/family_safety/manifest.json index 9c2e1c0..2b2e076 100644 --- a/custom_components/family_safety/manifest.json +++ b/custom_components/family_safety/manifest.json @@ -10,7 +10,7 @@ "iot_class": "cloud_polling", "issue_tracker": "https://github.com/pantherale0/ha-familysafety/issues", "requirements": [ - "pyfamilysafety==0.3.0" + "pyfamilysafety==1.0.0" ], "ssdp": [], "version": "1.2.0", diff --git a/requirements.txt b/requirements.txt index ac2ef8a..b99fc10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ colorlog==6.8.2 -homeassistant==2023.2.0 +homeassistant==2024.11.0 pip>=21.0,<24.3 ruff==0.1.9 pyfamilysafety==1.0.0 \ No newline at end of file