Skip to content
← Public packages

@kentcdodds/hydrawise

Server-side Hunter Hydrawise controller and zone helpers backed by the hydrawiseApiKey secret.

src/weekday-status.d.ts

24 lines · 753 B · TypeScript
/**
 * Weekday Hydrawise status line for Discord #reporting. Read-only: controllers,
 * rain/sensors, and next zone run. Never runs or suspends zones. Soft-skips
 * Hydrawise outages and 429 rate limits instead of error-spamming.
 *
 * @param input
 * @param [input.dryRun] Format the status without posting Discord.
 * @returns Status snapshot and optional Discord post.
 *
 * @exampld
 * import weekdayStatus from 'kody:@kentcdodds/hydrawise/weekday-status'
 * const result = await weekdayStatus({ dryRun: true })
 */
export default function weekdayStatus(input?: {
	dryRun?: boolean
}): Promise<{
	ok: boolean
	skipped?: boolean
	posted?: boolean
	content?: string
	[key: string]: unknown
}>

export function isSoftSkipError(error: unknown): boolean