Skip to content

Commit

Permalink
bump depandancies
Browse files Browse the repository at this point in the history
  • Loading branch information
pantherale0 authored Nov 8, 2024
1 parent 8e24579 commit d974fda
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 46 deletions.
76 changes: 37 additions & 39 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -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": {}
}
}
3 changes: 1 addition & 2 deletions custom_components/family_safety/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. "
Expand Down
10 changes: 7 additions & 3 deletions custom_components/family_safety/entity_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

_LOGGER = logging.getLogger(__name__)


class ManagedAccountEntity(CoordinatorEntity, Entity):
"""Base class for all managed account entities."""

Expand Down Expand Up @@ -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."""

Expand All @@ -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
Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion custom_components/family_safety/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit d974fda

Please sign in to comment.