Skip to content

Instantly share code, notes, and snippets.

@danwize
danwize / ge_double.yaml
Last active September 12, 2022 05:33 — forked from kpine/ge_double.yaml
GE/Jasco Double Tap Generic Blueprint
blueprint:
name: GE Switch Double Taps
description: Create automations to react to double taps from supporting GE switches.
domain: automation
input:
device:
name: Switch Device
description: A GE switch that supports double taps.
selector:
@danwize
danwize / CustomValidationAttributeAdapterProvider.cs
Created June 25, 2020 17:29 — forked from nickalbrecht/CustomValidationAttributeAdapterProvider.cs
Attribute to mark properties backed by primitive types or structs (int, DateTime, Guid, etc) as requiring a value other than their default value. `RequireNonDefaultAttribute` alone is enough for Server side validation. If you want to use this for client side as well, you'll need the other files too.
using System.ComponentModel.DataAnnotations;
using Microsoft.AspNetCore.Mvc.DataAnnotations;
using Microsoft.Extensions.Localization;
public class CustomValidationAttributeAdapterProvider : IValidationAttributeAdapterProvider
{
readonly IValidationAttributeAdapterProvider baseProvider = new ValidationAttributeAdapterProvider();
public IAttributeAdapter GetAttributeAdapter(ValidationAttribute attribute, IStringLocalizer stringLocalizer)
{