Revamp github integration (#64190)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
Co-authored-by: Franck Nijhof <git@frenck.dev>
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Joakim Sørensen 2022-01-18 20:04:01 +01:00 committed by GitHub
parent 37caa22a36
commit 6a0c3843e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 1113 additions and 246 deletions

View file

@ -0,0 +1,29 @@
"""Constants for the GitHub integration."""
from __future__ import annotations
from datetime import timedelta
from logging import Logger, getLogger
from typing import NamedTuple
from aiogithubapi import GitHubIssueModel
LOGGER: Logger = getLogger(__package__)
DOMAIN = "github"
CLIENT_ID = "1440cafcc86e3ea5d6a2"
DEFAULT_REPOSITORIES = ["home-assistant/core", "esphome/esphome"]
DEFAULT_UPDATE_INTERVAL = timedelta(seconds=300)
CONF_ACCESS_TOKEN = "access_token"
CONF_REPOSITORIES = "repositories"
class IssuesPulls(NamedTuple):
"""Issues and pull requests."""
issues_count: int
issue_last: GitHubIssueModel | None
pulls_count: int
pull_last: GitHubIssueModel | None