Updated apps
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Spook - Your homie."""
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
"""Spook - Your homie."""
|
||||
BIN
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
"""Spook - Your homie."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
|
||||
from ....const import DOMAIN
|
||||
from ....services import AbstractSpookService
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from homeassistant.core import ServiceCall
|
||||
|
||||
|
||||
class SpookService(AbstractSpookService):
|
||||
"""Spook service to fail a service call."""
|
||||
|
||||
domain = DOMAIN
|
||||
service = "boo"
|
||||
|
||||
async def async_handle_service(self, _: ServiceCall) -> None:
|
||||
"""Handle the service call."""
|
||||
msg = "Spooked!"
|
||||
raise HomeAssistantError(msg)
|
||||
@@ -0,0 +1,27 @@
|
||||
"""Spook - Your homie."""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import random
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
|
||||
from ....const import DOMAIN
|
||||
from ....services import AbstractSpookService
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from homeassistant.core import ServiceCall
|
||||
|
||||
|
||||
class SpookService(AbstractSpookService):
|
||||
"""Spook service to randomly fail a service call."""
|
||||
|
||||
domain = DOMAIN
|
||||
service = "random_fail"
|
||||
|
||||
async def async_handle_service(self, _: ServiceCall) -> None:
|
||||
"""Handle the service call."""
|
||||
if random.choice([True, False]): # noqa: S311
|
||||
msg = "Spooked!"
|
||||
raise HomeAssistantError(msg)
|
||||
Reference in New Issue
Block a user