Skip to content

Commit

Permalink
Create quotable integration and add the basics
Browse files Browse the repository at this point in the history
  • Loading branch information
siamzam committed Nov 5, 2023
1 parent 1bc0c46 commit a41cbe1
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
22 changes: 22 additions & 0 deletions homeassistant/components/quotable/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
"""The Quotable integration."""

import logging

from homeassistant.core import HomeAssistant
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import ConfigType

from .const import DOMAIN

_LOGGER = logging.getLogger(__name__)

CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)


def setup(hass: HomeAssistant, config: ConfigType) -> bool:
"""Set up the Quotable integration."""
_LOGGER.info("WIP: Setting up the Quotable integration")

hass.states.set(f"{DOMAIN}.testing", "It Works!")

return True
10 changes: 10 additions & 0 deletions homeassistant/components/quotable/const.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"""Constants for the Quotable integration."""

from typing import Final

DOMAIN: Final = "quotable"

BASE_URL: Final = "https://api.quotable.io"
GET_TAGS_URL: Final = f"{BASE_URL}/tags"
SEARCH_AUTHORS_URL: Final = f"{BASE_URL}/search/authors"
GET_QUOTES_URL: Final = f"{BASE_URL}/quotes/random"
9 changes: 9 additions & 0 deletions homeassistant/components/quotable/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"domain": "quotable",
"name": "Quotable",
"codeowners": [],
"dependencies": [],
"documentation": "https://github.com/lukePeavey/quotable",
"iot_class": "cloud_polling",
"requirements": []
}
6 changes: 6 additions & 0 deletions homeassistant/generated/integrations.json
Original file line number Diff line number Diff line change
Expand Up @@ -4547,6 +4547,12 @@
"config_flow": false,
"iot_class": "local_polling"
},
"quotable": {
"name": "Quotable",
"integration_type": "hub",
"config_flow": false,
"iot_class": "cloud_polling"
},
"qvr_pro": {
"name": "QVR Pro",
"integration_type": "hub",
Expand Down

0 comments on commit a41cbe1

Please sign in to comment.