Add files via upload

Initial upload. Yes AI was used to help make this. If you want to hate me, call me a vibe coder and yell hateful comments at me, you can do so as I am coming out of my house. I live at 1600 Pennsylvania Ave in lovely.....
This commit is contained in:
Lyfesaver
2025-10-02 14:56:10 -05:00
committed by GitHub
parent 839135cc84
commit 3b9257385c
7 changed files with 367 additions and 0 deletions

36
config_flow.py Normal file
View File

@@ -0,0 +1,36 @@
"""Config flow for Dispatcharr Sensor integration."""
from __future__ import annotations
import logging
from typing import Any
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.data_entry_flow import FlowResult
from .const import DOMAIN
_LOGGER = logging.getLogger(__name__)
# Ask for username and password instead of API token
STEP_USER_DATA_SCHEMA = vol.Schema(
{
vol.Required("host"): str,
vol.Required("port", default=9191): int,
vol.Required("username"): str,
vol.Required("password"): str,
}
)
class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
"""Handle a config flow for Dispatcharr Sensor."""
VERSION = 1
async def async_step_user(
self, user_input: dict[str, Any] | None = None
) -> FlowResult:
"""Handle the initial step."""
if user_input is None:
return self.async_show_form(
step_id="user", data_schema=STEP_USER_DATA_SCHEMA
)
return self.async_create_entry(title="Dispatcharr", data=user_input)