Skip to content

Commit

Permalink
Merge branch 'main' into ChrisCarini/pypiClassifier
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisCarini authored Oct 3, 2023
2 parents 91cead5 + afa467a commit 78e7dab
Show file tree
Hide file tree
Showing 12 changed files with 46 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
- name: Build wheels
if: needs.init.outputs.requirements == 'true'
uses: home-assistant/wheels@2023.09.1
uses: home-assistant/wheels@2023.10.1
with:
abi: cp311
tag: musllinux_1_2
Expand All @@ -125,7 +125,7 @@ jobs:

- name: Set up Python ${{ env.DEFAULT_PYTHON }}
if: needs.init.outputs.publish == 'true'
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ env.DEFAULT_PYTHON }}

Expand Down
20 changes: 10 additions & 10 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
uses: actions/[email protected]
- name: Set up Python
id: python
uses: actions/[email protected].0
uses: actions/[email protected].1
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
Expand Down Expand Up @@ -68,7 +68,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -112,7 +112,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -188,7 +188,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -229,7 +229,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -305,7 +305,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -346,7 +346,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down Expand Up @@ -404,7 +404,7 @@ jobs:
- name: Check out code from GitHub
uses: actions/[email protected]
- name: Set up Python ${{ needs.prepare.outputs.python-version }}
uses: actions/[email protected].0
uses: actions/[email protected].1
id: python
with:
python-version: ${{ needs.prepare.outputs.python-version }}
Expand Down
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ brotli==1.1.0
ciso8601==2.3.0
colorlog==6.7.0
cpe==1.2.1
cryptography==41.0.3
cryptography==41.0.4
debugpy==1.8.0
deepmerge==1.1.0
dirhash==0.2.1
docker==6.1.3
faust-cchardet==2.1.19
gitpython==3.1.36
gitpython==3.1.37
jinja2==3.1.2
pulsectl==23.5.2
pyudev==0.24.1
PyYAML==6.0.1
securetar==2023.3.0
sentry-sdk==1.31.0
voluptuous==0.13.1
dbus-fast==2.2.0
dbus-fast==2.10.0
typing_extensions==4.8.0
8 changes: 4 additions & 4 deletions requirements_tests.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
black==23.9.1
coverage==7.3.1
coverage==7.3.2
flake8-docstrings==1.7.0
flake8==6.1.0
pre-commit==3.4.0
pydocstyle==6.3.0
pylint==2.17.5
pylint==3.0.0
pytest-aiohttp==1.0.5
pytest-asyncio==0.18.3
pytest-cov==4.1.0
pytest-timeout==2.1.0
pytest==7.4.2
pyupgrade==3.10.1
pyupgrade==3.14.0
time-machine==2.13.0
typing_extensions==4.8.0
urllib3==2.0.5
urllib3==2.0.6
1 change: 1 addition & 0 deletions supervisor/api/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
ATTR_STARTUP_TIME = "startup_time"
ATTR_SUBSYSTEM = "subsystem"
ATTR_SYSFS = "sysfs"
ATTR_SYSTEM_HEALTH_LED = "system_health_led"
ATTR_TIME_DETECTED = "time_detected"
ATTR_UPDATE_TYPE = "update_type"
ATTR_USE_NTP = "use_ntp"
Expand Down
10 changes: 5 additions & 5 deletions supervisor/api/os.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
ATTR_SERIAL,
ATTR_SIZE,
ATTR_UPDATE_AVAILABLE,
ATTR_USER_LED,
ATTR_VERSION,
ATTR_VERSION_LATEST,
)
Expand All @@ -34,6 +33,7 @@
ATTR_DEVICE,
ATTR_DISKS,
ATTR_MODEL,
ATTR_SYSTEM_HEALTH_LED,
ATTR_VENDOR,
)
from .utils import api_process, api_validate
Expand All @@ -55,7 +55,7 @@
{
vol.Optional(ATTR_ACTIVITY_LED): vol.Boolean(),
vol.Optional(ATTR_POWER_LED): vol.Boolean(),
vol.Optional(ATTR_USER_LED): vol.Boolean(),
vol.Optional(ATTR_SYSTEM_HEALTH_LED): vol.Boolean(),
}
)
# pylint: enable=no-value-for-parameter
Expand Down Expand Up @@ -121,7 +121,7 @@ async def boards_green_info(self, request: web.Request) -> dict[str, Any]:
return {
ATTR_ACTIVITY_LED: self.sys_dbus.agent.board.green.activity_led,
ATTR_POWER_LED: self.sys_dbus.agent.board.green.power_led,
ATTR_USER_LED: self.sys_dbus.agent.board.green.user_led,
ATTR_SYSTEM_HEALTH_LED: self.sys_dbus.agent.board.green.user_led,
}

@api_process
Expand All @@ -135,8 +135,8 @@ async def boards_green_options(self, request: web.Request) -> None:
if ATTR_POWER_LED in body:
self.sys_dbus.agent.board.green.power_led = body[ATTR_POWER_LED]

if ATTR_USER_LED in body:
self.sys_dbus.agent.board.green.user_led = body[ATTR_USER_LED]
if ATTR_SYSTEM_HEALTH_LED in body:
self.sys_dbus.agent.board.green.user_led = body[ATTR_SYSTEM_HEALTH_LED]

self.sys_dbus.agent.board.green.save_data()

Expand Down
12 changes: 7 additions & 5 deletions supervisor/api/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,14 @@ async def store_info(self, request: web.Request) -> dict[str, Any]:
}

@api_process
async def addons_list(self, request: web.Request) -> list[dict[str, Any]]:
async def addons_list(self, request: web.Request) -> dict[str, Any]:
"""Return all store add-ons."""
return [
self._generate_addon_information(self.sys_addons.store[addon])
for addon in self.sys_addons.store
]
return {
ATTR_ADDONS: [
self._generate_addon_information(self.sys_addons.store[addon])
for addon in self.sys_addons.store
]
}

@api_process
def addons_addon_install(self, request: web.Request) -> Awaitable[None]:
Expand Down
4 changes: 2 additions & 2 deletions supervisor/backups/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def _restore() -> None:
_LOGGER.warning("Can't restore folder %s: %s", folder, err)

async def store_homeassistant(self):
"""Backup Home Assitant Core configuration folder."""
"""Backup Home Assistant Core configuration folder."""
self._data[ATTR_HOMEASSISTANT] = {ATTR_VERSION: self.sys_homeassistant.version}

# Backup Home Assistant Core config directory
Expand All @@ -557,7 +557,7 @@ async def store_homeassistant(self):
self.homeassistant[ATTR_SIZE] = homeassistant_file.size

async def restore_homeassistant(self) -> Awaitable[None]:
"""Restore Home Assitant Core configuration folder."""
"""Restore Home Assistant Core configuration folder."""
await self.sys_homeassistant.core.stop()

# Restore Home Assistant Core config directory
Expand Down
2 changes: 1 addition & 1 deletion supervisor/coresys.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ def now(self) -> datetime:
def sys_run_in_executor(
self, funct: Callable[..., T], *args: tuple[Any], **kwargs: dict[str, Any]
) -> Coroutine[Any, Any, T]:
"""Add an job to the executor pool."""
"""Add a job to the executor pool."""
return self.coresys.run_in_executor(funct, *args, **kwargs)

def sys_create_task(self, coroutine: Coroutine) -> asyncio.Task:
Expand Down
4 changes: 4 additions & 0 deletions supervisor/misc/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ..const import AddonState
from ..coresys import CoreSysAttributes
from ..exceptions import AddonsError, HomeAssistantError, ObserverError
from ..homeassistant.const import LANDINGPAGE
from ..jobs.decorator import Job, JobCondition
from ..plugins.const import PLUGIN_UPDATE_CONDITIONS
from ..utils.sentry import capture_exception
Expand Down Expand Up @@ -142,6 +143,9 @@ async def _watchdog_homeassistant_api(self):
if self.sys_homeassistant.error_state:
# Home Assistant is in an error state, this is handled by the rollback feature
return
if self.sys_homeassistant.version == LANDINGPAGE:
# Skip watchdog for landingpage
return
if not await self.sys_homeassistant.core.is_running():
# The home assistant container is not running
return
Expand Down
8 changes: 6 additions & 2 deletions tests/api/test_os.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ async def test_api_board_green_info(
result = await resp.json()
assert result["data"]["activity_led"] is True
assert result["data"]["power_led"] is True
assert result["data"]["user_led"] is True
assert result["data"]["system_health_led"] is True

assert (await api_client.get("/os/boards/yellow")).status == 400
assert (await api_client.get("/os/boards/supervised")).status == 400
Expand All @@ -203,7 +203,11 @@ async def test_api_board_green_options(
with patch.object(BoardProxy, "save_data") as save_data:
resp = await api_client.post(
"/os/boards/green",
json={"activity_led": False, "power_led": False, "user_led": False},
json={
"activity_led": False,
"power_led": False,
"system_health_led": False,
},
)
assert resp.status == 200
save_data.assert_called_once()
Expand Down
2 changes: 1 addition & 1 deletion tests/api/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ async def test_api_store_addons(api_client: TestClient, store_addon: AddonStore)
result = await resp.json()
print(result)

assert result["data"][-1]["slug"] == store_addon.slug
assert result["data"]["addons"][-1]["slug"] == store_addon.slug


@pytest.mark.asyncio
Expand Down

0 comments on commit 78e7dab

Please sign in to comment.