mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-21 10:15:04 +02:00
Add Home Assistant as notification provider (#656)
Sends persistent notifications to the HA dashboard using the existing HA connection from Settings. Zero config — just select "Home Assistant" as provider type. Users can forward notifications to mobile via HA automations.
This commit is contained in:
@@ -12,7 +12,7 @@ interface AddNotificationModalProps {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
const PROVIDER_VALUES: ProviderType[] = ['email', 'telegram', 'discord', 'ntfy', 'pushover', 'callmebot', 'webhook'];
|
||||
const PROVIDER_VALUES: ProviderType[] = ['email', 'telegram', 'discord', 'ntfy', 'pushover', 'callmebot', 'webhook', 'homeassistant'];
|
||||
|
||||
export function AddNotificationModal({ provider, onClose }: AddNotificationModalProps) {
|
||||
const { t } = useTranslation();
|
||||
@@ -210,6 +210,8 @@ export function AddNotificationModal({ provider, onClose }: AddNotificationModal
|
||||
{ key: 'field_title', label: 'Title Field Name', placeholder: 'title', type: 'text', required: false, showIf: (cfg: Record<string, string>) => cfg.payload_format !== 'slack' },
|
||||
{ key: 'field_message', label: 'Message Field Name', placeholder: 'message', type: 'text', required: false, showIf: (cfg: Record<string, string>) => cfg.payload_format !== 'slack' },
|
||||
];
|
||||
case 'homeassistant':
|
||||
return [];
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
@@ -337,7 +339,7 @@ export function AddNotificationModal({ provider, onClose }: AddNotificationModal
|
||||
setTestResult(null);
|
||||
testMutation.mutate();
|
||||
}}
|
||||
disabled={testMutation.isPending || !config[getRequiredFields(providerType)[0]?.key]}
|
||||
disabled={testMutation.isPending || (getRequiredFields(providerType).length > 0 && !config[getRequiredFields(providerType)[0]?.key])}
|
||||
className="flex-1"
|
||||
>
|
||||
{testMutation.isPending ? (
|
||||
|
||||
Reference in New Issue
Block a user