Skip to content

Commit

Permalink
[create-pull-request] automated change (#80)
Browse files Browse the repository at this point in the history
Co-authored-by: MatthewFlamm <[email protected]>
  • Loading branch information
MatthewFlamm and MatthewFlamm authored Aug 27, 2021
1 parent d1f02dc commit aeb684c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 25 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pytest-homeassistant-custom-component

![HA core version](https://img.shields.io/static/v1?label=HA+core+version&message=2021.8.0b0&labelColor=blue)
![HA core version](https://img.shields.io/static/v1?label=HA+core+version&message=2021.9.0b2&labelColor=blue)

Package to automatically extract testing plugins from Home Assistant for custom component testing.
The goal is to provide the same functionality as the tests in home-assistant/core.
Expand Down
13 changes: 11 additions & 2 deletions pytest_homeassistant_custom_component/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,9 @@
providers as auth_providers,
)
from homeassistant.auth.permissions import system_policies
from homeassistant.components import recorder
from homeassistant.components import device_automation, recorder
from homeassistant.components.device_automation import ( # noqa: F401
_async_get_device_automation_capabilities as async_get_device_automation_capabilities,
_async_get_device_automations as async_get_device_automations,
)
from homeassistant.components.mqtt.models import ReceiveMessage
from homeassistant.config import async_process_component_config
Expand Down Expand Up @@ -74,6 +73,16 @@
CLIENT_REDIRECT_URI = "https://example.com/app/callback"


async def async_get_device_automations(
hass: HomeAssistant, automation_type: str, device_id: str
) -> Any:
"""Get a device automation for a single device id."""
automations = await device_automation.async_get_device_automations(
hass, automation_type, [device_id]
)
return automations.get(device_id)


def threadsafe_callback_factory(func):
"""Create threadsafe functions out of callbacks.
Expand Down
4 changes: 2 additions & 2 deletions pytest_homeassistant_custom_component/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from typing import Final

MAJOR_VERSION: Final = 2021
MINOR_VERSION: Final = 8
PATCH_VERSION: Final = "0b0"
MINOR_VERSION: Final = 9
PATCH_VERSION: Final = "0b2"
__short_version__: Final = f"{MAJOR_VERSION}.{MINOR_VERSION}"
__version__: Final = f"{__short_version__}.{PATCH_VERSION}"
37 changes: 19 additions & 18 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# This file is originally from homeassistant/core and modified by pytest-homeassistant-custom-component.
codecov==2.1.11
mypy==0.902
pre-commit==2.13.0
pylint==2.9.5
types-backports==0.1.2
types-certifi==0.1.3
types-chardet==0.1.2
codecov==2.1.12
mypy==0.910
pre-commit==2.14.0
pylint==2.10.2
types-croniter==1.0.0
types-backports==0.1.3
types-certifi==0.1.4
types-chardet==0.1.5
types-cryptography==3.3.2
types-decorator==0.1.4
types-emoji==1.2.1
types-enum34==0.1.5
types-ipaddress==0.1.2
types-decorator==0.1.7
types-emoji==1.2.4
types-enum34==0.1.8
types-ipaddress==0.1.5
types-jwt==0.1.3
types-pkg-resources==0.1.2
types-python-slugify==0.1.0
types-pytz==0.1.1
types-PyYAML==5.4.1
types-requests==0.1.11
types-toml==0.1.2
types-ujson==0.1.0
types-pkg-resources==0.1.3
types-python-slugify==0.1.2
types-pytz==2021.1.2
types-PyYAML==5.4.6
types-requests==2.25.1
types-toml==0.1.5
types-ujson==0.1.1
7 changes: 5 additions & 2 deletions requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
# make new things fail. Manually update these pins when pulling in a
# new version

# types-* that have versions roughly corresponding to the packages they
# contain hints for available should be kept in sync with them

-c homeassistant/package_constraints.txt
-r requirements_test_pre_commit.txt
coverage==5.5
Expand All @@ -22,6 +25,6 @@ responses==0.12.0
respx==0.17.0
stdlib-list==0.7.0
tqdm==4.49.0
homeassistant==2021.8.0b0
sqlalchemy==1.4.17
homeassistant==2021.9.0b2
sqlalchemy==1.4.23

0 comments on commit aeb684c

Please sign in to comment.