14209 lines
652 KiB
C#
14209 lines
652 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// Generated using NetDaemon CodeGenerator nd-codegen v26.11.0.0
|
|
// At: 2026-03-31T22:16:06.7505553+03:00
|
|
//
|
|
// *** Make sure the version of the codegen tool and your nugets NetDaemon.* have the same version.***
|
|
// You can use following command to keep it up to date with the latest version:
|
|
// dotnet tool update NetDaemon.HassModel.CodeGen
|
|
//
|
|
// To update this file with latest entities run this command in your project directory:
|
|
// dotnet tool run nd-codegen
|
|
//
|
|
// In the template projects we provided a convenience powershell script that will update
|
|
// the codegen and nugets to latest versions update_all_dependencies.ps1.
|
|
//
|
|
// For more information: https://netdaemon.xyz/docs/user/hass_model/hass_model_codegen
|
|
// For more information about NetDaemon: https://netdaemon.xyz/
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
#nullable enable
|
|
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using NetDaemon.HassModel;
|
|
using NetDaemon.HassModel.Entities;
|
|
using NetDaemon.HassModel.Entities.Core;
|
|
|
|
namespace HomeAssistantGenerated;
|
|
public static class GeneratedExtensions
|
|
{
|
|
///<summary>Registers all injectable generated types in the serviceCollection</summary>
|
|
public static IServiceCollection AddHomeAssistantGenerated(this IServiceCollection serviceCollection)
|
|
{
|
|
serviceCollection.AddTransient<IEntityFactory, GeneratedEntityFactory>();
|
|
serviceCollection.AddTransient<Entities>();
|
|
serviceCollection.AddTransient<LightEntities>();
|
|
serviceCollection.AddTransient<MediaPlayerEntities>();
|
|
serviceCollection.AddTransient<AutomationEntities>();
|
|
serviceCollection.AddTransient<BinarySensorEntities>();
|
|
serviceCollection.AddTransient<ButtonEntities>();
|
|
serviceCollection.AddTransient<ClimateEntities>();
|
|
serviceCollection.AddTransient<ConversationEntities>();
|
|
serviceCollection.AddTransient<CounterEntities>();
|
|
serviceCollection.AddTransient<DeviceTrackerEntities>();
|
|
serviceCollection.AddTransient<EventEntities>();
|
|
serviceCollection.AddTransient<FanEntities>();
|
|
serviceCollection.AddTransient<HumidifierEntities>();
|
|
serviceCollection.AddTransient<InputBooleanEntities>();
|
|
serviceCollection.AddTransient<InputDatetimeEntities>();
|
|
serviceCollection.AddTransient<InputNumberEntities>();
|
|
serviceCollection.AddTransient<NumberEntities>();
|
|
serviceCollection.AddTransient<PersonEntities>();
|
|
serviceCollection.AddTransient<RemoteEntities>();
|
|
serviceCollection.AddTransient<ScriptEntities>();
|
|
serviceCollection.AddTransient<SelectEntities>();
|
|
serviceCollection.AddTransient<SensorEntities>();
|
|
serviceCollection.AddTransient<SunEntities>();
|
|
serviceCollection.AddTransient<SwitchEntities>();
|
|
serviceCollection.AddTransient<TextEntities>();
|
|
serviceCollection.AddTransient<TtsEntities>();
|
|
serviceCollection.AddTransient<UpdateEntities>();
|
|
serviceCollection.AddTransient<WeatherEntities>();
|
|
serviceCollection.AddTransient<ZoneEntities>();
|
|
serviceCollection.AddTransient<Services>();
|
|
serviceCollection.AddTransient<AlarmControlPanelServices>();
|
|
serviceCollection.AddTransient<AutomationServices>();
|
|
serviceCollection.AddTransient<BackupServices>();
|
|
serviceCollection.AddTransient<BlueprintServices>();
|
|
serviceCollection.AddTransient<ButtonServices>();
|
|
serviceCollection.AddTransient<CameraServices>();
|
|
serviceCollection.AddTransient<ClimateServices>();
|
|
serviceCollection.AddTransient<CloudServices>();
|
|
serviceCollection.AddTransient<ConversationServices>();
|
|
serviceCollection.AddTransient<CounterServices>();
|
|
serviceCollection.AddTransient<CoverServices>();
|
|
serviceCollection.AddTransient<DeviceTrackerServices>();
|
|
serviceCollection.AddTransient<FanServices>();
|
|
serviceCollection.AddTransient<FfmpegServices>();
|
|
serviceCollection.AddTransient<FileServices>();
|
|
serviceCollection.AddTransient<FrontendServices>();
|
|
serviceCollection.AddTransient<HassioServices>();
|
|
serviceCollection.AddTransient<HomeassistantServices>();
|
|
serviceCollection.AddTransient<HumidifierServices>();
|
|
serviceCollection.AddTransient<InputBooleanServices>();
|
|
serviceCollection.AddTransient<InputButtonServices>();
|
|
serviceCollection.AddTransient<InputDatetimeServices>();
|
|
serviceCollection.AddTransient<InputNumberServices>();
|
|
serviceCollection.AddTransient<InputSelectServices>();
|
|
serviceCollection.AddTransient<InputTextServices>();
|
|
serviceCollection.AddTransient<LightServices>();
|
|
serviceCollection.AddTransient<LocaltuyaServices>();
|
|
serviceCollection.AddTransient<LockServices>();
|
|
serviceCollection.AddTransient<LogbookServices>();
|
|
serviceCollection.AddTransient<LoggerServices>();
|
|
serviceCollection.AddTransient<MediaPlayerServices>();
|
|
serviceCollection.AddTransient<MqttServices>();
|
|
serviceCollection.AddTransient<NordpoolServices>();
|
|
serviceCollection.AddTransient<NotifyServices>();
|
|
serviceCollection.AddTransient<NumberServices>();
|
|
serviceCollection.AddTransient<PersistentNotificationServices>();
|
|
serviceCollection.AddTransient<PersonServices>();
|
|
serviceCollection.AddTransient<RecorderServices>();
|
|
serviceCollection.AddTransient<RemoteServices>();
|
|
serviceCollection.AddTransient<RepairsServices>();
|
|
serviceCollection.AddTransient<SceneServices>();
|
|
serviceCollection.AddTransient<ScheduleServices>();
|
|
serviceCollection.AddTransient<ScriptServices>();
|
|
serviceCollection.AddTransient<SelectServices>();
|
|
serviceCollection.AddTransient<SirenServices>();
|
|
serviceCollection.AddTransient<SystemLogServices>();
|
|
serviceCollection.AddTransient<SonoffServices>();
|
|
serviceCollection.AddTransient<SpookServices>();
|
|
serviceCollection.AddTransient<SwitchServices>();
|
|
serviceCollection.AddTransient<TemplateServices>();
|
|
serviceCollection.AddTransient<TextServices>();
|
|
serviceCollection.AddTransient<TimeServices>();
|
|
serviceCollection.AddTransient<TimerServices>();
|
|
serviceCollection.AddTransient<TtsServices>();
|
|
serviceCollection.AddTransient<UpdateServices>();
|
|
serviceCollection.AddTransient<VacuumServices>();
|
|
serviceCollection.AddTransient<ValveServices>();
|
|
serviceCollection.AddTransient<WeatherServices>();
|
|
serviceCollection.AddTransient<ZhaServices>();
|
|
serviceCollection.AddTransient<ZhaToolkitServices>();
|
|
serviceCollection.AddTransient<ZoneServices>();
|
|
return serviceCollection;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Allows HassModel to instantiate the correct generated Entity types
|
|
/// </summary>
|
|
public class GeneratedEntityFactory : IEntityFactory
|
|
{
|
|
public Entity CreateEntity(IHaContext haContext, string entityId)
|
|
{
|
|
var dot = entityId.IndexOf('.', StringComparison.Ordinal);
|
|
var domain = dot < 0 ? entityId.AsSpan() : entityId[..dot];
|
|
return domain switch
|
|
{
|
|
"automation" => new AutomationEntity(haContext, entityId),
|
|
"binary_sensor" => new BinarySensorEntity(haContext, entityId),
|
|
"button" => new ButtonEntity(haContext, entityId),
|
|
"climate" => new ClimateEntity(haContext, entityId),
|
|
"conversation" => new ConversationEntity(haContext, entityId),
|
|
"counter" => new CounterEntity(haContext, entityId),
|
|
"device_tracker" => new DeviceTrackerEntity(haContext, entityId),
|
|
"event" => new EventEntity(haContext, entityId),
|
|
"fan" => new FanEntity(haContext, entityId),
|
|
"humidifier" => new HumidifierEntity(haContext, entityId),
|
|
"input_boolean" => new InputBooleanEntity(haContext, entityId),
|
|
"input_datetime" => new InputDatetimeEntity(haContext, entityId),
|
|
"input_number" => new InputNumberEntity(haContext, entityId),
|
|
"light" => new LightEntity(haContext, entityId),
|
|
"media_player" => new MediaPlayerEntity(haContext, entityId),
|
|
"number" => new NumberEntity(haContext, entityId),
|
|
"person" => new PersonEntity(haContext, entityId),
|
|
"remote" => new RemoteEntity(haContext, entityId),
|
|
"script" => new ScriptEntity(haContext, entityId),
|
|
"select" => new SelectEntity(haContext, entityId),
|
|
"sensor" when IsNumeric() => new NumericSensorEntity(haContext, entityId),
|
|
"sensor" => new SensorEntity(haContext, entityId),
|
|
"sun" => new SunEntity(haContext, entityId),
|
|
"switch" => new SwitchEntity(haContext, entityId),
|
|
"text" => new TextEntity(haContext, entityId),
|
|
"tts" => new TtsEntity(haContext, entityId),
|
|
"update" => new UpdateEntity(haContext, entityId),
|
|
"weather" => new WeatherEntity(haContext, entityId),
|
|
"zone" => new ZoneEntity(haContext, entityId),
|
|
_ => new Entity(haContext, entityId)};
|
|
bool IsNumeric() => haContext.GetState(entityId)?.AttributesJson?.TryGetProperty("unit_of_measurement", out _) ?? false;
|
|
}
|
|
}
|
|
|
|
public interface IEntities
|
|
{
|
|
LightEntities Light { get; }
|
|
|
|
MediaPlayerEntities MediaPlayer { get; }
|
|
|
|
AutomationEntities Automation { get; }
|
|
|
|
BinarySensorEntities BinarySensor { get; }
|
|
|
|
ButtonEntities Button { get; }
|
|
|
|
ClimateEntities Climate { get; }
|
|
|
|
ConversationEntities Conversation { get; }
|
|
|
|
CounterEntities Counter { get; }
|
|
|
|
DeviceTrackerEntities DeviceTracker { get; }
|
|
|
|
EventEntities Event { get; }
|
|
|
|
FanEntities Fan { get; }
|
|
|
|
HumidifierEntities Humidifier { get; }
|
|
|
|
InputBooleanEntities InputBoolean { get; }
|
|
|
|
InputDatetimeEntities InputDatetime { get; }
|
|
|
|
InputNumberEntities InputNumber { get; }
|
|
|
|
NumberEntities Number { get; }
|
|
|
|
PersonEntities Person { get; }
|
|
|
|
RemoteEntities Remote { get; }
|
|
|
|
ScriptEntities Script { get; }
|
|
|
|
SelectEntities Select { get; }
|
|
|
|
SensorEntities Sensor { get; }
|
|
|
|
SunEntities Sun { get; }
|
|
|
|
SwitchEntities Switch { get; }
|
|
|
|
TextEntities Text { get; }
|
|
|
|
TtsEntities Tts { get; }
|
|
|
|
UpdateEntities Update { get; }
|
|
|
|
WeatherEntities Weather { get; }
|
|
|
|
ZoneEntities Zone { get; }
|
|
}
|
|
|
|
public partial class Entities : IEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public Entities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public LightEntities Light => new(_haContext);
|
|
public MediaPlayerEntities MediaPlayer => new(_haContext);
|
|
public AutomationEntities Automation => new(_haContext);
|
|
public BinarySensorEntities BinarySensor => new(_haContext);
|
|
public ButtonEntities Button => new(_haContext);
|
|
public ClimateEntities Climate => new(_haContext);
|
|
public ConversationEntities Conversation => new(_haContext);
|
|
public CounterEntities Counter => new(_haContext);
|
|
public DeviceTrackerEntities DeviceTracker => new(_haContext);
|
|
public EventEntities Event => new(_haContext);
|
|
public FanEntities Fan => new(_haContext);
|
|
public HumidifierEntities Humidifier => new(_haContext);
|
|
public InputBooleanEntities InputBoolean => new(_haContext);
|
|
public InputDatetimeEntities InputDatetime => new(_haContext);
|
|
public InputNumberEntities InputNumber => new(_haContext);
|
|
public NumberEntities Number => new(_haContext);
|
|
public PersonEntities Person => new(_haContext);
|
|
public RemoteEntities Remote => new(_haContext);
|
|
public ScriptEntities Script => new(_haContext);
|
|
public SelectEntities Select => new(_haContext);
|
|
public SensorEntities Sensor => new(_haContext);
|
|
public SunEntities Sun => new(_haContext);
|
|
public SwitchEntities Switch => new(_haContext);
|
|
public TextEntities Text => new(_haContext);
|
|
public TtsEntities Tts => new(_haContext);
|
|
public UpdateEntities Update => new(_haContext);
|
|
public WeatherEntities Weather => new(_haContext);
|
|
public ZoneEntities Zone => new(_haContext);
|
|
}
|
|
|
|
public partial class LightEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public LightEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all light entities currently registered (at runtime) in Home Assistant as LightEntity</summary>
|
|
public IEnumerable<LightEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("light.")).Select(e => new LightEntity(e));
|
|
///<summary>Edge LED</summary>
|
|
public LightEntity Sonoff1002214d40 => new(_haContext, "light.sonoff_1002214d40");
|
|
}
|
|
|
|
public partial class MediaPlayerEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public MediaPlayerEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all media_player entities currently registered (at runtime) in Home Assistant as MediaPlayerEntity</summary>
|
|
public IEnumerable<MediaPlayerEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("media_player.")).Select(e => new MediaPlayerEntity(e));
|
|
public MediaPlayerEntity _123prasaunenuplyskQe75q77datxxh => new(_haContext, "media_player.123prasaunenuplysk_qe75q77datxxh");
|
|
///<summary>123PrasauNenuplysk (QE75Q77DATXXH)</summary>
|
|
public MediaPlayerEntity _123prasaunenuplyskQe75q77datxxh2 => new(_haContext, "media_player.123prasaunenuplysk_qe75q77datxxh_2");
|
|
}
|
|
|
|
public partial class AutomationEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public AutomationEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all automation entities currently registered (at runtime) in Home Assistant as AutomationEntity</summary>
|
|
public IEnumerable<AutomationEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("automation.")).Select(e => new AutomationEntity(e));
|
|
///<summary>AC cool on</summary>
|
|
public AutomationEntity AcCoolOn => new(_haContext, "automation.ac_cool_on");
|
|
///<summary>AC tun off</summary>
|
|
public AutomationEntity AcTunOff => new(_haContext, "automation.ac_tun_off");
|
|
///<summary>Auto turn off boiler</summary>
|
|
public AutomationEntity AutoTurnOffBoiler => new(_haContext, "automation.auto_turn_off_boiler");
|
|
///<summary>Boiler turn on counter</summary>
|
|
public AutomationEntity BoilerTurnOnCounter => new(_haContext, "automation.boiler_turn_on_counter");
|
|
///<summary>Christmas lights sync</summary>
|
|
public AutomationEntity ChristmasLightsSync => new(_haContext, "automation.christmas_lights_sync");
|
|
///<summary>Christmas lights sync v2</summary>
|
|
public AutomationEntity ChristmasLightsSyncV2 => new(_haContext, "automation.christmas_lights_sync_v2");
|
|
///<summary>Dehumidifier on counter</summary>
|
|
public AutomationEntity DehumidifierOnOffCounter => new(_haContext, "automation.dehumidifier_on_off_counter");
|
|
///<summary>Lamp sync off</summary>
|
|
public AutomationEntity LampSyncOff => new(_haContext, "automation.lamp_sync_off");
|
|
///<summary>Lamp sync on</summary>
|
|
public AutomationEntity LampSyncOn => new(_haContext, "automation.lamp_sync_on");
|
|
///<summary>Turn off dehumidifier</summary>
|
|
public AutomationEntity TurnOfDehumidifier => new(_haContext, "automation.turn_of_dehumidifier");
|
|
///<summary>Turn Off all lights</summary>
|
|
public AutomationEntity TurnOffAllLights => new(_haContext, "automation.turn_off_all_lights");
|
|
///<summary>TurnOn Dehumidifier then not at home</summary>
|
|
public AutomationEntity TurnonDehumidifierThenNotAtHome => new(_haContext, "automation.turnon_dehumidifier_then_not_at_home");
|
|
}
|
|
|
|
public partial class BinarySensorEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public BinarySensorEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all binary_sensor entities currently registered (at runtime) in Home Assistant as BinarySensorEntity</summary>
|
|
public IEnumerable<BinarySensorEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("binary_sensor.")).Select(e => new BinarySensorEntity(e));
|
|
///<summary>Aquarium leak sensor</summary>
|
|
public BinarySensorEntity AquariumLeakSensor => new(_haContext, "binary_sensor.aquarium_leak_sensor");
|
|
///<summary>Boiler Moisture</summary>
|
|
public BinarySensorEntity BoilerMoisture => new(_haContext, "binary_sensor.boiler_moisture");
|
|
///<summary>Boiler Monitor Budget exhausted</summary>
|
|
public BinarySensorEntity BoilermonitorBudgetExhausted => new(_haContext, "binary_sensor.boilermonitor_budget_exhausted");
|
|
///<summary>Low Storage</summary>
|
|
public BinarySensorEntity LowStorage => new(_haContext, "binary_sensor.low_storage");
|
|
///<summary>Marius Watch Is charging</summary>
|
|
public BinarySensorEntity MariusWatchIsCharging => new(_haContext, "binary_sensor.marius_watch_is_charging");
|
|
///<summary>Marius Watch On body sensor</summary>
|
|
public BinarySensorEntity MariusWatchOnBodySensor => new(_haContext, "binary_sensor.marius_watch_on_body_sensor");
|
|
///<summary>Marius Phone Is charging</summary>
|
|
public BinarySensorEntity SmS936bIsCharging => new(_haContext, "binary_sensor.sm_s936b_is_charging");
|
|
///<summary>Marius Phone Mobile data</summary>
|
|
public BinarySensorEntity SmS936bMobileData => new(_haContext, "binary_sensor.sm_s936b_mobile_data");
|
|
///<summary>Marius Phone Wi-Fi state</summary>
|
|
public BinarySensorEntity SmS936bWiFiState => new(_haContext, "binary_sensor.sm_s936b_wi_fi_state");
|
|
///<summary>Connection State</summary>
|
|
public BinarySensorEntity WellbeingAirPurifier2Connectionstate => new(_haContext, "binary_sensor.wellbeing_air_purifier_2_connectionstate");
|
|
///<summary>Ionizer</summary>
|
|
public BinarySensorEntity WellbeingAirPurifier2Ionizer => new(_haContext, "binary_sensor.wellbeing_air_purifier_2_ionizer");
|
|
///<summary>Safety Lock</summary>
|
|
public BinarySensorEntity WellbeingAirPurifier2Safetylock => new(_haContext, "binary_sensor.wellbeing_air_purifier_2_safetylock");
|
|
///<summary>Status</summary>
|
|
public BinarySensorEntity WellbeingAirPurifier2Status => new(_haContext, "binary_sensor.wellbeing_air_purifier_2_status");
|
|
///<summary>UI Light</summary>
|
|
public BinarySensorEntity WellbeingAirPurifier2Uilight => new(_haContext, "binary_sensor.wellbeing_air_purifier_2_uilight");
|
|
}
|
|
|
|
public partial class ButtonEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ButtonEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all button entities currently registered (at runtime) in Home Assistant as ButtonEntity</summary>
|
|
public IEnumerable<ButtonEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("button.")).Select(e => new ButtonEntity(e));
|
|
///<summary>Boiler Moisture Identify</summary>
|
|
public ButtonEntity BoilerMoistureIdentify => new(_haContext, "button.boiler_moisture_identify");
|
|
///<summary>Boiler room Temp Identify</summary>
|
|
public ButtonEntity BoilerTempIdentify => new(_haContext, "button.boiler_temp_identify");
|
|
///<summary>Boiler Monitor Cleanup all entities</summary>
|
|
public ButtonEntity BoilermonitorCleanup => new(_haContext, "button.boilermonitor_cleanup");
|
|
///<summary>Home Assistant Reload</summary>
|
|
public ButtonEntity HomeassistantReload => new(_haContext, "button.homeassistant_reload");
|
|
///<summary>Home Assistant Restart</summary>
|
|
public ButtonEntity HomeassistantRestart => new(_haContext, "button.homeassistant_restart");
|
|
///<summary>Repairs Ignore all</summary>
|
|
public ButtonEntity IgnoreAllIssues => new(_haContext, "button.ignore_all_issues");
|
|
///<summary>Rediscover power sensors</summary>
|
|
public ButtonEntity PowermonitorRediscoverSensors => new(_haContext, "button.powermonitor_rediscover_sensors");
|
|
///<summary>Repairs Unignore all</summary>
|
|
public ButtonEntity UnignoreAllIssues => new(_haContext, "button.unignore_all_issues");
|
|
}
|
|
|
|
public partial class ClimateEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ClimateEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all climate entities currently registered (at runtime) in Home Assistant as ClimateEntity</summary>
|
|
public IEnumerable<ClimateEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("climate.")).Select(e => new ClimateEntity(e));
|
|
///<summary>AC</summary>
|
|
public ClimateEntity AirConditioner => new(_haContext, "climate.air_conditioner");
|
|
///<summary>Bathroom Thermostat</summary>
|
|
public ClimateEntity BathroomThermostat => new(_haContext, "climate.bathroom_thermostat");
|
|
///<summary>Main Home Termostat</summary>
|
|
public ClimateEntity MainHomeTermostat => new(_haContext, "climate.main_home_termostat");
|
|
///<summary>Windows Termostat</summary>
|
|
public ClimateEntity WindowsTermostat => new(_haContext, "climate.windows_termostat");
|
|
}
|
|
|
|
public partial class ConversationEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ConversationEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all conversation entities currently registered (at runtime) in Home Assistant as ConversationEntity</summary>
|
|
public IEnumerable<ConversationEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("conversation.")).Select(e => new ConversationEntity(e));
|
|
///<summary>Home Assistant</summary>
|
|
public ConversationEntity HomeAssistant => new(_haContext, "conversation.home_assistant");
|
|
}
|
|
|
|
public partial class CounterEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public CounterEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all counter entities currently registered (at runtime) in Home Assistant as CounterEntity</summary>
|
|
public IEnumerable<CounterEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("counter.")).Select(e => new CounterEntity(e));
|
|
///<summary>AC on/off counter</summary>
|
|
public CounterEntity AcOnOffCounter => new(_haContext, "counter.ac_on_off_counter");
|
|
///<summary>Boiler turn on count</summary>
|
|
public CounterEntity BoilerTurnOnCount => new(_haContext, "counter.boiler_turn_on_count");
|
|
///<summary>Dehumidifier on counter</summary>
|
|
public CounterEntity DehumidifierOnOffCounter => new(_haContext, "counter.dehumidifier_on_off_counter");
|
|
}
|
|
|
|
public partial class DeviceTrackerEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public DeviceTrackerEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all device_tracker entities currently registered (at runtime) in Home Assistant as DeviceTrackerEntity</summary>
|
|
public IEnumerable<DeviceTrackerEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("device_tracker.")).Select(e => new DeviceTrackerEntity(e));
|
|
///<summary>Erika's iPhone</summary>
|
|
public DeviceTrackerEntity ErikaSIphone => new(_haContext, "device_tracker.erika_s_iphone");
|
|
///<summary>Home Phone</summary>
|
|
public DeviceTrackerEntity HomePhone => new(_haContext, "device_tracker.home_phone");
|
|
///<summary>Marius Phone</summary>
|
|
public DeviceTrackerEntity SmS936b => new(_haContext, "device_tracker.sm_s936b");
|
|
}
|
|
|
|
public partial class EventEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public EventEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all event entities currently registered (at runtime) in Home Assistant as EventEntity</summary>
|
|
public IEnumerable<EventEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("event.")).Select(e => new EventEntity(e));
|
|
///<summary>Repairs</summary>
|
|
public EventEntity Repair => new(_haContext, "event.repair");
|
|
}
|
|
|
|
public partial class FanEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public FanEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all fan entities currently registered (at runtime) in Home Assistant as FanEntity</summary>
|
|
public IEnumerable<FanEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("fan.")).Select(e => new FanEntity(e));
|
|
///<summary>Fan Speed</summary>
|
|
public FanEntity WellbeingAirPurifier2Fanspeed => new(_haContext, "fan.wellbeing_air_purifier_2_fanspeed");
|
|
}
|
|
|
|
public partial class HumidifierEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public HumidifierEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all humidifier entities currently registered (at runtime) in Home Assistant as HumidifierEntity</summary>
|
|
public IEnumerable<HumidifierEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("humidifier.")).Select(e => new HumidifierEntity(e));
|
|
///<summary>Auto Dehumidifier</summary>
|
|
public HumidifierEntity AutoDehumidifier => new(_haContext, "humidifier.auto_dehumidifier");
|
|
}
|
|
|
|
public partial class InputBooleanEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputBooleanEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all input_boolean entities currently registered (at runtime) in Home Assistant as InputBooleanEntity</summary>
|
|
public IEnumerable<InputBooleanEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("input_boolean.")).Select(e => new InputBooleanEntity(e));
|
|
///<summary>AC on/off</summary>
|
|
public InputBooleanEntity AcOnOff => new(_haContext, "input_boolean.ac_on_off");
|
|
///<summary>Boiler Boost Mode</summary>
|
|
public InputBooleanEntity BoilerBoostMode => new(_haContext, "input_boolean.boiler_boost_mode");
|
|
///<summary>Christmas lights </summary>
|
|
public InputBooleanEntity ChristmasLights => new(_haContext, "input_boolean.christmas_lights");
|
|
///<summary>netdaemon_boiler_monitor_manager_boiler_monitor_init</summary>
|
|
public InputBooleanEntity NetdaemonBoilerMonitorManagerBoilerMonitorInit => new(_haContext, "input_boolean.netdaemon_boiler_monitor_manager_boiler_monitor_init");
|
|
///<summary>netdaemon_nord_pool_manager_nord_pool_init</summary>
|
|
public InputBooleanEntity NetdaemonNordPoolManagerNordPoolInit => new(_haContext, "input_boolean.netdaemon_nord_pool_manager_nord_pool_init");
|
|
}
|
|
|
|
public partial class InputDatetimeEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputDatetimeEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all input_datetime entities currently registered (at runtime) in Home Assistant as InputDatetimeEntity</summary>
|
|
public IEnumerable<InputDatetimeEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("input_datetime.")).Select(e => new InputDatetimeEntity(e));
|
|
///<summary>Boiler Ready By</summary>
|
|
public InputDatetimeEntity BoilerReadyBy => new(_haContext, "input_datetime.boiler_ready_by");
|
|
}
|
|
|
|
public partial class InputNumberEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputNumberEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all input_number entities currently registered (at runtime) in Home Assistant as InputNumberEntity</summary>
|
|
public IEnumerable<InputNumberEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("input_number.")).Select(e => new InputNumberEntity(e));
|
|
///<summary>Boiler Daily Hours</summary>
|
|
public InputNumberEntity BoilerDailyHours => new(_haContext, "input_number.boiler_daily_hours");
|
|
///<summary>Boiler price cap</summary>
|
|
public InputNumberEntity BoilerPriceCap => new(_haContext, "input_number.boiler_price_cap");
|
|
}
|
|
|
|
public partial class NumberEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public NumberEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all number entities currently registered (at runtime) in Home Assistant as NumberEntity</summary>
|
|
public IEnumerable<NumberEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("number.")).Select(e => new NumberEntity(e));
|
|
///<summary>Bathroom Comfort humidity max</summary>
|
|
public NumberEntity BathroomComfortHumidityMax => new(_haContext, "number.bathroom_comfort_humidity_max");
|
|
///<summary>Bathroom Comfort humidity min</summary>
|
|
public NumberEntity BathroomComfortHumidityMin => new(_haContext, "number.bathroom_comfort_humidity_min");
|
|
///<summary>Bathroom Comfort temperature max</summary>
|
|
public NumberEntity BathroomComfortTemperatureMax => new(_haContext, "number.bathroom_comfort_temperature_max");
|
|
///<summary>Bathroom Comfort temperature min</summary>
|
|
public NumberEntity BathroomComfortTemperatureMin => new(_haContext, "number.bathroom_comfort_temperature_min");
|
|
///<summary>Bedroom Comfort humidity max</summary>
|
|
public NumberEntity BedroomComfortHumidityMax => new(_haContext, "number.bedroom_comfort_humidity_max");
|
|
///<summary>Bedroom Comfort humidity min</summary>
|
|
public NumberEntity BedroomComfortHumidityMin => new(_haContext, "number.bedroom_comfort_humidity_min");
|
|
///<summary>Bedroom Comfort temperature max</summary>
|
|
public NumberEntity BedroomComfortTemperatureMax => new(_haContext, "number.bedroom_comfort_temperature_max");
|
|
///<summary>Bedroom Comfort temperature min</summary>
|
|
public NumberEntity BedroomComfortTemperatureMin => new(_haContext, "number.bedroom_comfort_temperature_min");
|
|
///<summary>Boiler room Temp Comfort humidity max</summary>
|
|
public NumberEntity BoilerTempComfortHumidityMax => new(_haContext, "number.boiler_temp_comfort_humidity_max");
|
|
///<summary>Boiler room Temp Comfort humidity min</summary>
|
|
public NumberEntity BoilerTempComfortHumidityMin => new(_haContext, "number.boiler_temp_comfort_humidity_min");
|
|
///<summary>Boiler room Temp Comfort temperature max</summary>
|
|
public NumberEntity BoilerTempComfortTemperatureMax => new(_haContext, "number.boiler_temp_comfort_temperature_max");
|
|
///<summary>Boiler room Temp Comfort temperature min</summary>
|
|
public NumberEntity BoilerTempComfortTemperatureMin => new(_haContext, "number.boiler_temp_comfort_temperature_min");
|
|
///<summary>Boiler room Temp Humidity offset</summary>
|
|
public NumberEntity BoilerTempHumidityOffset => new(_haContext, "number.boiler_temp_humidity_offset");
|
|
///<summary>Boiler room Temp Temperature offset</summary>
|
|
public NumberEntity BoilerTempTemperatureOffset => new(_haContext, "number.boiler_temp_temperature_offset");
|
|
///<summary>Boiler Monitor Heating power threshold (watts)</summary>
|
|
public NumberEntity BoilermonitorConfigHeatingThreshold => new(_haContext, "number.boilermonitor_config_heating_threshold");
|
|
///<summary>Boiler Monitor Poll interval (seconds)</summary>
|
|
public NumberEntity BoilermonitorConfigPollInterval => new(_haContext, "number.boilermonitor_config_poll_interval");
|
|
///<summary>Main Home Comfort humidity max</summary>
|
|
public NumberEntity MainHomeComfortHumidityMax => new(_haContext, "number.main_home_comfort_humidity_max");
|
|
///<summary>Main Home Comfort humidity min</summary>
|
|
public NumberEntity MainHomeComfortHumidityMin => new(_haContext, "number.main_home_comfort_humidity_min");
|
|
///<summary>Main Home Comfort temperature max</summary>
|
|
public NumberEntity MainHomeComfortTemperatureMax => new(_haContext, "number.main_home_comfort_temperature_max");
|
|
///<summary>Main Home Comfort temperature min</summary>
|
|
public NumberEntity MainHomeComfortTemperatureMin => new(_haContext, "number.main_home_comfort_temperature_min");
|
|
}
|
|
|
|
public partial class PersonEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public PersonEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all person entities currently registered (at runtime) in Home Assistant as PersonEntity</summary>
|
|
public IEnumerable<PersonEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("person.")).Select(e => new PersonEntity(e));
|
|
///<summary>Erika</summary>
|
|
public PersonEntity Erika => new(_haContext, "person.erika");
|
|
///<summary>Home Phone</summary>
|
|
public PersonEntity HomePhone => new(_haContext, "person.home_phone");
|
|
///<summary>Marius</summary>
|
|
public PersonEntity Marius => new(_haContext, "person.marius");
|
|
}
|
|
|
|
public partial class RemoteEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public RemoteEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all remote entities currently registered (at runtime) in Home Assistant as RemoteEntity</summary>
|
|
public IEnumerable<RemoteEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("remote.")).Select(e => new RemoteEntity(e));
|
|
public RemoteEntity _123prasaunenuplyskQe75q77datxxh => new(_haContext, "remote.123prasaunenuplysk_qe75q77datxxh");
|
|
///<summary>123PrasauNenuplysk (QE75Q77DATXXH)</summary>
|
|
public RemoteEntity _123prasaunenuplyskQe75q77datxxh2 => new(_haContext, "remote.123prasaunenuplysk_qe75q77datxxh_2");
|
|
}
|
|
|
|
public partial class ScriptEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ScriptEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all script entities currently registered (at runtime) in Home Assistant as ScriptEntity</summary>
|
|
public IEnumerable<ScriptEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("script.")).Select(e => new ScriptEntity(e));
|
|
///<summary>System: Purge Device History</summary>
|
|
public ScriptEntity SystemPurgeDeviceHistory => new(_haContext, "script.system_purge_device_history");
|
|
///<summary>Update NordPool Prices</summary>
|
|
public ScriptEntity Updatenordpoolprices => new(_haContext, "script.updatenordpoolprices");
|
|
}
|
|
|
|
public partial class SelectEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SelectEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all select entities currently registered (at runtime) in Home Assistant as SelectEntity</summary>
|
|
public IEnumerable<SelectEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("select.")).Select(e => new SelectEntity(e));
|
|
///<summary>Akvariumas Power-on behavior</summary>
|
|
public SelectEntity AkvariumasStartUpBehavior => new(_haContext, "select.akvariumas_start_up_behavior");
|
|
///<summary>3D print Power-on behavior</summary>
|
|
public SelectEntity BalkonyLapsStartUpBehavior => new(_haContext, "select.balkony_laps_start_up_behavior");
|
|
///<summary>Bathroom Display unit</summary>
|
|
public SelectEntity BathroomDisplayUnit => new(_haContext, "select.bathroom_display_unit");
|
|
///<summary>Bedroom Display unit</summary>
|
|
public SelectEntity BedroomDisplayUnit => new(_haContext, "select.bedroom_display_unit");
|
|
///<summary>Boiler room Temp Display unit</summary>
|
|
public SelectEntity BoilerTempDisplayUnit => new(_haContext, "select.boiler_temp_display_unit");
|
|
///<summary>Dishwasher Power-on behavior</summary>
|
|
public SelectEntity DishwasherStartUpBehavior => new(_haContext, "select.dishwasher_start_up_behavior");
|
|
///<summary>Exhaust Fan Power-on behavior</summary>
|
|
public SelectEntity ExhaustFanStartUpBehavior => new(_haContext, "select.exhaust_fan_start_up_behavior");
|
|
///<summary>Fridge Power-on behavior</summary>
|
|
public SelectEntity FridgeStartUpBehavior => new(_haContext, "select.fridge_start_up_behavior");
|
|
///<summary>Heating Relay Far Power-on behavior</summary>
|
|
public SelectEntity HeatingStartUpBehavior => new(_haContext, "select.heating_start_up_behavior");
|
|
///<summary>Heating Relay Bathroom Power-on behavior</summary>
|
|
public SelectEntity HeatingStartUpBehavior2 => new(_haContext, "select.heating_start_up_behavior_2");
|
|
///<summary>Heating Relay Middle Power-on behavior</summary>
|
|
public SelectEntity HeatingStartUpBehavior3 => new(_haContext, "select.heating_start_up_behavior_3");
|
|
///<summary>Main Home Display unit</summary>
|
|
public SelectEntity MainHomeDisplayUnit => new(_haContext, "select.main_home_display_unit");
|
|
///<summary>Induction Startup</summary>
|
|
public SelectEntity Sonoff10018909cbStartup => new(_haContext, "select.sonoff_10018909cb_startup");
|
|
///<summary>AC</summary>
|
|
public SelectEntity Sonoff100215c5341 => new(_haContext, "select.sonoff_100215c534_1");
|
|
///<summary>Lamp</summary>
|
|
public SelectEntity Sonoff100222f7be1 => new(_haContext, "select.sonoff_100222f7be_1");
|
|
///<summary>Christmas tree</summary>
|
|
public SelectEntity Sonoff100222ff361 => new(_haContext, "select.sonoff_100222ff36_1");
|
|
///<summary>Stair lamps</summary>
|
|
public SelectEntity Sonoff100222ff631 => new(_haContext, "select.sonoff_100222ff63_1");
|
|
///<summary>Po laiptais</summary>
|
|
public SelectEntity Sonoff1002230a481 => new(_haContext, "select.sonoff_1002230a48_1");
|
|
///<summary>Boiler</summary>
|
|
public SelectEntity Sonoff1002230e321 => new(_haContext, "select.sonoff_1002230e32_1");
|
|
///<summary>Washer</summary>
|
|
public SelectEntity Sonoff100255ead81 => new(_haContext, "select.sonoff_100255ead8_1");
|
|
///<summary>Dryer</summary>
|
|
public SelectEntity Sonoff100255f06c1 => new(_haContext, "select.sonoff_100255f06c_1");
|
|
///<summary>Cat Christmas lamps</summary>
|
|
public SelectEntity Sonoff100255f7381 => new(_haContext, "select.sonoff_100255f738_1");
|
|
///<summary>Dehumidifier</summary>
|
|
public SelectEntity Sonoff10025606e61 => new(_haContext, "select.sonoff_10025606e6_1");
|
|
///<summary>Salt Lamp</summary>
|
|
public SelectEntity Sonoff10025609ce1 => new(_haContext, "select.sonoff_10025609ce_1");
|
|
///<summary>Home meter</summary>
|
|
public SelectEntity Sonoff100267d63f1 => new(_haContext, "select.sonoff_100267d63f_1");
|
|
///<summary>LED power Power-on behavior</summary>
|
|
public SelectEntity SonoffS60zbtpfStartUpBehavior => new(_haContext, "select.sonoff_s60zbtpf_start_up_behavior");
|
|
///<summary>Air Purifirier Power-on behavior</summary>
|
|
public SelectEntity SonoffS60zbtpfStartUpBehavior2 => new(_haContext, "select.sonoff_s60zbtpf_start_up_behavior_2");
|
|
///<summary>Network Infra Power-on behavior</summary>
|
|
public SelectEntity TempStartUpBehavior => new(_haContext, "select.temp_start_up_behavior");
|
|
///<summary>TV Power-on behavior</summary>
|
|
public SelectEntity TvStartUpBehavior => new(_haContext, "select.tv_start_up_behavior");
|
|
///<summary>Washing room Display unit</summary>
|
|
public SelectEntity WashingRoomDisplayUnit => new(_haContext, "select.washing_room_display_unit");
|
|
}
|
|
|
|
public partial class SensorEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SensorEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all sensor entities currently registered (at runtime) in Home Assistant as SensorEntity</summary>
|
|
public IEnumerable<SensorEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("sensor.")).Select(e => new SensorEntity(e));
|
|
/// <summary>Enumerates all non-numeric sensor entities currently registered (at runtime) in Home Assistant as SensorEntity</summary>
|
|
public IEnumerable<SensorEntity> EnumerateAllNonNumeric() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("sensor.") && !(e.EntityState?.AttributesJson?.TryGetProperty("unit_of_measurement", out _) ?? false)).Select(e => new SensorEntity(e));
|
|
/// <summary>Enumerates all numeric sensor entities currently registered (at runtime) in Home Assistant as NumericSensorEntity</summary>
|
|
public IEnumerable<NumericSensorEntity> EnumerateAllNumeric() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("sensor.") && (e.EntityState?.AttributesJson?.TryGetProperty("unit_of_measurement", out _) ?? false)).Select(e => new NumericSensorEntity(e));
|
|
///<summary>AC status</summary>
|
|
public SensorEntity AcStatus => new(_haContext, "sensor.ac_status");
|
|
///<summary>Air Purified Status</summary>
|
|
public SensorEntity AirPurifiedStatus => new(_haContext, "sensor.air_purified_status");
|
|
///<summary>Home Assistant Air quality</summary>
|
|
public SensorEntity AirQuality => new(_haContext, "sensor.air_quality");
|
|
///<summary>Akvariumas Status</summary>
|
|
public SensorEntity AkvariumasStatus => new(_haContext, "sensor.akvariumas_status");
|
|
///<summary>Home Assistant Alarm control panels</summary>
|
|
public SensorEntity AlarmControlPanels => new(_haContext, "sensor.alarm_control_panels");
|
|
///<summary>Home Assistant Areas</summary>
|
|
public SensorEntity Areas => new(_haContext, "sensor.areas");
|
|
///<summary>Home Assistant Automations</summary>
|
|
public SensorEntity Automations => new(_haContext, "sensor.automations");
|
|
///<summary>Backup Last attempted automatic backup</summary>
|
|
public SensorEntity BackupLastAttemptedAutomaticBackup => new(_haContext, "sensor.backup_last_attempted_automatic_backup");
|
|
///<summary>Backup Last successful automatic backup</summary>
|
|
public SensorEntity BackupLastSuccessfulAutomaticBackup => new(_haContext, "sensor.backup_last_successful_automatic_backup");
|
|
///<summary>Home Assistant Binary sensors</summary>
|
|
public SensorEntity BinarySensors => new(_haContext, "sensor.binary_sensors");
|
|
///<summary>Boiler running</summary>
|
|
public SensorEntity BoilerRunning => new(_haContext, "sensor.boiler_running");
|
|
///<summary>Boiler Monitor Heating sessions today</summary>
|
|
public SensorEntity BoilermonitorSessionCount => new(_haContext, "sensor.boilermonitor_session_count");
|
|
///<summary>Boiler Monitor Boiler Monitor status</summary>
|
|
public SensorEntity BoilermonitorStatus => new(_haContext, "sensor.boilermonitor_status");
|
|
///<summary>Boiler Monitor Boiler water ready</summary>
|
|
public SensorEntity BoilermonitorWaterReady => new(_haContext, "sensor.boilermonitor_water_ready");
|
|
///<summary>Home Assistant Buttons</summary>
|
|
public SensorEntity Buttons => new(_haContext, "sensor.buttons");
|
|
///<summary>Home Assistant Calendars</summary>
|
|
public SensorEntity Calendars => new(_haContext, "sensor.calendars");
|
|
///<summary>Home Assistant Cameras</summary>
|
|
public SensorEntity Cameras => new(_haContext, "sensor.cameras");
|
|
///<summary>Home Assistant Climate</summary>
|
|
public SensorEntity Climate => new(_haContext, "sensor.climate");
|
|
///<summary>Home Assistant Covers</summary>
|
|
public SensorEntity Covers => new(_haContext, "sensor.covers");
|
|
///<summary>Home Assistant Custom integrations</summary>
|
|
public SensorEntity CustomIntegrations => new(_haContext, "sensor.custom_integrations");
|
|
///<summary>Home Assistant Dates</summary>
|
|
public SensorEntity Dates => new(_haContext, "sensor.dates");
|
|
///<summary>Home Assistant Date/times</summary>
|
|
public SensorEntity Datetimes => new(_haContext, "sensor.datetimes");
|
|
///<summary>Dehumidifier status</summary>
|
|
public SensorEntity DehumidifierStatus => new(_haContext, "sensor.dehumidifier_status");
|
|
///<summary>Home Assistant Device trackers</summary>
|
|
public SensorEntity DeviceTrackers => new(_haContext, "sensor.device_trackers");
|
|
///<summary>Home Assistant Devices</summary>
|
|
public SensorEntity Devices => new(_haContext, "sensor.devices");
|
|
///<summary>Dishwasher status</summary>
|
|
public SensorEntity DishwasherStatus => new(_haContext, "sensor.dishwasher_status");
|
|
///<summary>Dryer Status</summary>
|
|
public SensorEntity DryerStatus => new(_haContext, "sensor.dryer_status");
|
|
///<summary>Home Assistant Entities</summary>
|
|
public SensorEntity Entities => new(_haContext, "sensor.entities");
|
|
///<summary>Erika's iPhone Battery State</summary>
|
|
public SensorEntity ErikaSIphoneBatteryState => new(_haContext, "sensor.erika_s_iphone_battery_state");
|
|
///<summary>Erika's iPhone Connection Type</summary>
|
|
public SensorEntity ErikaSIphoneConnectionType => new(_haContext, "sensor.erika_s_iphone_connection_type");
|
|
///<summary>Erika's iPhone Geocoded Location</summary>
|
|
public SensorEntity ErikaSIphoneGeocodedLocation => new(_haContext, "sensor.erika_s_iphone_geocoded_location");
|
|
///<summary>Erika's iPhone SSID</summary>
|
|
public SensorEntity ErikaSIphoneSsid => new(_haContext, "sensor.erika_s_iphone_ssid");
|
|
///<summary>Home Assistant Fans</summary>
|
|
public SensorEntity Fans => new(_haContext, "sensor.fans");
|
|
///<summary>Home Assistant Operating System Newest version</summary>
|
|
public SensorEntity HomeAssistantOperatingSystemNewestVersion => new(_haContext, "sensor.home_assistant_operating_system_newest_version");
|
|
///<summary>Home Assistant Operating System Version</summary>
|
|
public SensorEntity HomeAssistantOperatingSystemVersion => new(_haContext, "sensor.home_assistant_operating_system_version");
|
|
///<summary>Home Phone Battery state</summary>
|
|
public SensorEntity HomePhoneBatteryState => new(_haContext, "sensor.home_phone_battery_state");
|
|
///<summary>Home Phone Charger type</summary>
|
|
public SensorEntity HomePhoneChargerType => new(_haContext, "sensor.home_phone_charger_type");
|
|
///<summary>Home Assistant Humidifiers</summary>
|
|
public SensorEntity Humidifiers => new(_haContext, "sensor.humidifiers");
|
|
///<summary>Home Assistant Images</summary>
|
|
public SensorEntity Images => new(_haContext, "sensor.images");
|
|
///<summary>Home Assistant Input booleans</summary>
|
|
public SensorEntity InputBooleans => new(_haContext, "sensor.input_booleans");
|
|
///<summary>Home Assistant Input buttons</summary>
|
|
public SensorEntity InputButtons => new(_haContext, "sensor.input_buttons");
|
|
///<summary>Home Assistant Input date/times</summary>
|
|
public SensorEntity InputDatetimes => new(_haContext, "sensor.input_datetimes");
|
|
///<summary>Home Assistant Input numbers</summary>
|
|
public SensorEntity InputNumbers => new(_haContext, "sensor.input_numbers");
|
|
///<summary>Home Assistant Input selects</summary>
|
|
public SensorEntity InputSelects => new(_haContext, "sensor.input_selects");
|
|
///<summary>Home Assistant Input texts</summary>
|
|
public SensorEntity InputTexts => new(_haContext, "sensor.input_texts");
|
|
///<summary>Home Assistant Integrations</summary>
|
|
public SensorEntity Integrations => new(_haContext, "sensor.integrations");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Air quality index</summary>
|
|
public SensorEntity KaunasNoreikiskesLithuaniaAirQualityIndex => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_air_quality_index");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Carbon monoxide</summary>
|
|
public SensorEntity KaunasNoreikiskesLithuaniaCarbonMonoxide => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_carbon_monoxide");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Dominant pollutant</summary>
|
|
public SensorEntity KaunasNoreikiskesLithuaniaDominantPollutant => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_dominant_pollutant");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Ozone</summary>
|
|
public SensorEntity KaunasNoreikiskesLithuaniaOzone => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_ozone");
|
|
///<summary>Kaunas Noreikiskes, Lithuania PM10</summary>
|
|
public SensorEntity KaunasNoreikiskesLithuaniaPm10 => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_pm10");
|
|
///<summary>Kaunas Noreikiskes, Lithuania PM2.5</summary>
|
|
public SensorEntity KaunasNoreikiskesLithuaniaPm25 => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_pm2_5");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Sulphur dioxide</summary>
|
|
public SensorEntity KaunasNoreikiskesLithuaniaSulphurDioxide => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_sulphur_dioxide");
|
|
///<summary>Home Assistant Lights</summary>
|
|
public SensorEntity Lights => new(_haContext, "sensor.lights");
|
|
///<summary>Home Assistant Locks</summary>
|
|
public SensorEntity Locks => new(_haContext, "sensor.locks");
|
|
///<summary>Marius Watch Activity state</summary>
|
|
public SensorEntity MariusWatchActivityState => new(_haContext, "sensor.marius_watch_activity_state");
|
|
///<summary>Marius Watch Battery health</summary>
|
|
public SensorEntity MariusWatchBatteryHealth => new(_haContext, "sensor.marius_watch_battery_health");
|
|
///<summary>Marius Watch Battery state</summary>
|
|
public SensorEntity MariusWatchBatteryState => new(_haContext, "sensor.marius_watch_battery_state");
|
|
///<summary>Marius Watch Charger type</summary>
|
|
public SensorEntity MariusWatchChargerType => new(_haContext, "sensor.marius_watch_charger_type");
|
|
///<summary>Marius Watch Network type</summary>
|
|
public SensorEntity MariusWatchNetworkType => new(_haContext, "sensor.marius_watch_network_type");
|
|
///<summary>Home Assistant Media players</summary>
|
|
public SensorEntity MediaPlayers => new(_haContext, "sensor.media_players");
|
|
///<summary>Nord Pool LT Last updated</summary>
|
|
public SensorEntity NordPoolLtLastUpdated => new(_haContext, "sensor.nord_pool_lt_last_updated");
|
|
///<summary>Boiler water ready</summary>
|
|
public SensorEntity NordpoolBoilerWaterReady => new(_haContext, "sensor.nordpool_boiler_water_ready");
|
|
///<summary>NordPool NordPool cheapest boiler intervals</summary>
|
|
public SensorEntity NordpoolCheapestIntervals => new(_haContext, "sensor.nordpool_cheapest_intervals");
|
|
///<summary>NordPool NordPool last update time</summary>
|
|
public SensorEntity NordpoolLastUpdateTime => new(_haContext, "sensor.nordpool_last_update_time");
|
|
///<summary>NordPool NordPool today prices</summary>
|
|
public SensorEntity NordpoolTodayPrices => new(_haContext, "sensor.nordpool_today_prices");
|
|
///<summary>NordPool NordPool today and tomorrow prices</summary>
|
|
public SensorEntity NordpoolTodayTomorrowPrices => new(_haContext, "sensor.nordpool_today_tomorrow_prices");
|
|
///<summary>NordPool NordPool tomorrow prices</summary>
|
|
public SensorEntity NordpoolTomorrowPrices => new(_haContext, "sensor.nordpool_tomorrow_prices");
|
|
///<summary>Home Assistant Numbers</summary>
|
|
public SensorEntity Numbers => new(_haContext, "sensor.numbers");
|
|
///<summary>Home Assistant Persistent notifications</summary>
|
|
public SensorEntity PersistentNotifications => new(_haContext, "sensor.persistent_notifications");
|
|
///<summary>Home Assistant Persons</summary>
|
|
public SensorEntity Persons => new(_haContext, "sensor.persons");
|
|
///<summary>Home Assistant Remotes</summary>
|
|
public SensorEntity Remotes => new(_haContext, "sensor.remotes");
|
|
///<summary>Home Assistant Scenes</summary>
|
|
public SensorEntity Scenes => new(_haContext, "sensor.scenes");
|
|
///<summary>Home Assistant Scripts</summary>
|
|
public SensorEntity Scripts => new(_haContext, "sensor.scripts");
|
|
///<summary>Home Assistant Selects</summary>
|
|
public SensorEntity Selects => new(_haContext, "sensor.selects");
|
|
///<summary>Home Assistant Sensors</summary>
|
|
public SensorEntity Sensors => new(_haContext, "sensor.sensors");
|
|
///<summary>Home Assistant Sirens</summary>
|
|
public SensorEntity Sirens => new(_haContext, "sensor.sirens");
|
|
///<summary>System Monitor Last boot</summary>
|
|
public SensorEntity SystemMonitorLastBoot => new(_haContext, "sensor.system_monitor_last_boot");
|
|
///<summary>Marius Phone Battery health</summary>
|
|
public SensorEntity SmS936bBatteryHealth => new(_haContext, "sensor.sm_s936b_battery_health");
|
|
///<summary>Marius Phone Battery state</summary>
|
|
public SensorEntity SmS936bBatteryState => new(_haContext, "sensor.sm_s936b_battery_state");
|
|
///<summary>Marius Phone Detected activity</summary>
|
|
public SensorEntity SmS936bDetectedActivity => new(_haContext, "sensor.sm_s936b_detected_activity");
|
|
///<summary>Marius Phone Geocoded location</summary>
|
|
public SensorEntity SmS936bGeocodedLocation => new(_haContext, "sensor.sm_s936b_geocoded_location");
|
|
///<summary>Marius Phone Network type</summary>
|
|
public SensorEntity SmS936bNetworkType => new(_haContext, "sensor.sm_s936b_network_type");
|
|
///<summary>Marius Phone Phone state</summary>
|
|
public SensorEntity SmS936bPhoneState => new(_haContext, "sensor.sm_s936b_phone_state");
|
|
///<summary>Marius Phone SIM 1</summary>
|
|
public SensorEntity SmS936bSim1 => new(_haContext, "sensor.sm_s936b_sim_1");
|
|
///<summary>Marius Phone Wi-Fi connection</summary>
|
|
public SensorEntity SmS936bWiFiConnection => new(_haContext, "sensor.sm_s936b_wi_fi_connection");
|
|
///<summary>Main Device Connection</summary>
|
|
public SensorEntity Sonoff1002479627Connection => new(_haContext, "sensor.sonoff_1002479627_connection");
|
|
///<summary>Home Assistant Speech-to-text</summary>
|
|
public SensorEntity Stt => new(_haContext, "sensor.stt");
|
|
///<summary>Sun Next dawn</summary>
|
|
public SensorEntity SunNextDawn => new(_haContext, "sensor.sun_next_dawn");
|
|
///<summary>Sun Next dusk</summary>
|
|
public SensorEntity SunNextDusk => new(_haContext, "sensor.sun_next_dusk");
|
|
///<summary>Sun Next midnight</summary>
|
|
public SensorEntity SunNextMidnight => new(_haContext, "sensor.sun_next_midnight");
|
|
///<summary>Sun Next noon</summary>
|
|
public SensorEntity SunNextNoon => new(_haContext, "sensor.sun_next_noon");
|
|
///<summary>Sun Next rising</summary>
|
|
public SensorEntity SunNextRising => new(_haContext, "sensor.sun_next_rising");
|
|
///<summary>Sun Next setting</summary>
|
|
public SensorEntity SunNextSetting => new(_haContext, "sensor.sun_next_setting");
|
|
///<summary>Home Assistant Suns</summary>
|
|
public SensorEntity Suns => new(_haContext, "sensor.suns");
|
|
///<summary>Home Assistant Switches</summary>
|
|
public SensorEntity Switches => new(_haContext, "sensor.switches");
|
|
///<summary>Home Assistant Texts</summary>
|
|
public SensorEntity Texts => new(_haContext, "sensor.texts");
|
|
///<summary>Home Assistant Times</summary>
|
|
public SensorEntity Times => new(_haContext, "sensor.times");
|
|
///<summary>Home Assistant Text-to-speech</summary>
|
|
public SensorEntity Tts => new(_haContext, "sensor.tts");
|
|
///<summary>Home Assistant Update</summary>
|
|
public SensorEntity Update => new(_haContext, "sensor.update");
|
|
///<summary>Home Assistant Vacuums</summary>
|
|
public SensorEntity Vacuums => new(_haContext, "sensor.vacuums");
|
|
///<summary>Washer Status</summary>
|
|
public SensorEntity WasherStatus => new(_haContext, "sensor.washer_status");
|
|
///<summary>Home Assistant Water heaters</summary>
|
|
public SensorEntity WaterHeaters => new(_haContext, "sensor.water_heaters");
|
|
///<summary>Home Assistant Weather</summary>
|
|
public SensorEntity Weather => new(_haContext, "sensor.weather");
|
|
///<summary>Home Assistant Zones</summary>
|
|
public SensorEntity Zones => new(_haContext, "sensor.zones");
|
|
///<summary>Repairs Active</summary>
|
|
public NumericSensorEntity ActiveIssues => new(_haContext, "sensor.active_issues");
|
|
///<summary>Akvariumas Power</summary>
|
|
public NumericSensorEntity AkvariumasPower => new(_haContext, "sensor.akvariumas_power");
|
|
///<summary>Akvariumas Voltage</summary>
|
|
public NumericSensorEntity AkvariumasVoltage => new(_haContext, "sensor.akvariumas_voltage");
|
|
///<summary>Aquarium leak sensor Battery</summary>
|
|
public NumericSensorEntity AquariumLeakSensorBattery => new(_haContext, "sensor.aquarium_leak_sensor_battery");
|
|
///<summary>3D print Power</summary>
|
|
public NumericSensorEntity BalkonyLapsPower => new(_haContext, "sensor.balkony_laps_power");
|
|
///<summary>3D print Voltage</summary>
|
|
public NumericSensorEntity BalkonyLapsVoltage => new(_haContext, "sensor.balkony_laps_voltage");
|
|
///<summary>Bathroom Battery</summary>
|
|
public NumericSensorEntity BathroomBattery => new(_haContext, "sensor.bathroom_battery");
|
|
///<summary>Bathroom Humidity</summary>
|
|
public NumericSensorEntity BathroomHumidity => new(_haContext, "sensor.bathroom_humidity");
|
|
///<summary>Bathroom Temperature</summary>
|
|
public NumericSensorEntity BathroomTemperature => new(_haContext, "sensor.bathroom_temperature");
|
|
///<summary>Bedroom Battery</summary>
|
|
public NumericSensorEntity BedroomBattery => new(_haContext, "sensor.bedroom_battery");
|
|
///<summary>Bedroom Humidity</summary>
|
|
public NumericSensorEntity BedroomHumidity => new(_haContext, "sensor.bedroom_humidity");
|
|
///<summary>Bedroom Temperature</summary>
|
|
public NumericSensorEntity BedroomTemperature => new(_haContext, "sensor.bedroom_temperature");
|
|
///<summary>Boiler Moisture Battery</summary>
|
|
public NumericSensorEntity BoilerMoistureBattery => new(_haContext, "sensor.boiler_moisture_battery");
|
|
///<summary>Boiler run time</summary>
|
|
public NumericSensorEntity BoilerRunTime => new(_haContext, "sensor.boiler_run_time");
|
|
///<summary>Boiler room Temp Battery</summary>
|
|
public NumericSensorEntity BoilerTempBattery => new(_haContext, "sensor.boiler_temp_battery");
|
|
///<summary>Boiler room Temp Humidity</summary>
|
|
public NumericSensorEntity BoilerTempHumidity => new(_haContext, "sensor.boiler_temp_humidity");
|
|
///<summary>Boiler room Temp Temperature</summary>
|
|
public NumericSensorEntity BoilerTempTemperature => new(_haContext, "sensor.boiler_temp_temperature");
|
|
///<summary>Boiler Monitor Budget usage</summary>
|
|
public NumericSensorEntity BoilermonitorBudgetPercentage => new(_haContext, "sensor.boilermonitor_budget_percentage");
|
|
///<summary>Boiler Monitor Remaining budget time</summary>
|
|
public NumericSensorEntity BoilermonitorRemainingTime => new(_haContext, "sensor.boilermonitor_remaining_time");
|
|
///<summary>Boiler Monitor Today runtime</summary>
|
|
public NumericSensorEntity BoilermonitorTodayRuntime => new(_haContext, "sensor.boilermonitor_today_runtime");
|
|
///<summary>Cat Area Temp Battery</summary>
|
|
public NumericSensorEntity CatAreaTempBattery => new(_haContext, "sensor.cat_area_temp_battery");
|
|
///<summary>Cat Area Temp Humidity</summary>
|
|
public NumericSensorEntity CatAreaTempHumidity => new(_haContext, "sensor.cat_area_temp_humidity");
|
|
///<summary>Cat Area Temp Temperature</summary>
|
|
public NumericSensorEntity CatAreaTempTemperature => new(_haContext, "sensor.cat_area_temp_temperature");
|
|
///<summary>Current SetPoint</summary>
|
|
public NumericSensorEntity CurrentSetpoint => new(_haContext, "sensor.current_setpoint");
|
|
///<summary>Dehumidifier running time</summary>
|
|
public NumericSensorEntity DehumidifierRunningTime => new(_haContext, "sensor.dehumidifier_running_time");
|
|
///<summary>Dishwasher Power</summary>
|
|
public NumericSensorEntity DishwasherPower => new(_haContext, "sensor.dishwasher_power");
|
|
///<summary>Dishwasher Voltage</summary>
|
|
public NumericSensorEntity DishwasherVoltage => new(_haContext, "sensor.dishwasher_voltage");
|
|
///<summary>Erika's iPhone Battery Level</summary>
|
|
public NumericSensorEntity ErikaSIphoneBatteryLevel => new(_haContext, "sensor.erika_s_iphone_battery_level");
|
|
///<summary>Fridge Power</summary>
|
|
public NumericSensorEntity FridgePower => new(_haContext, "sensor.fridge_power");
|
|
///<summary>Fridge Voltage</summary>
|
|
public NumericSensorEntity FridgeVoltage => new(_haContext, "sensor.fridge_voltage");
|
|
///<summary>Home Phone Battery level</summary>
|
|
public NumericSensorEntity HomePhoneBatteryLevel => new(_haContext, "sensor.home_phone_battery_level");
|
|
///<summary>Repairs Ignored</summary>
|
|
public NumericSensorEntity IgnoredIssues => new(_haContext, "sensor.ignored_issues");
|
|
///<summary>Repairs Total</summary>
|
|
public NumericSensorEntity Issues => new(_haContext, "sensor.issues");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Humidity</summary>
|
|
public NumericSensorEntity KaunasNoreikiskesLithuaniaHumidity => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_humidity");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Pressure</summary>
|
|
public NumericSensorEntity KaunasNoreikiskesLithuaniaPressure => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_pressure");
|
|
///<summary>Kaunas Noreikiskes, Lithuania Temperature</summary>
|
|
public NumericSensorEntity KaunasNoreikiskesLithuaniaTemperature => new(_haContext, "sensor.kaunas_noreikiskes_lithuania_temperature");
|
|
///<summary>Main Home Battery</summary>
|
|
public NumericSensorEntity MainHomeBattery => new(_haContext, "sensor.main_home_battery");
|
|
///<summary>Main Home Humidity</summary>
|
|
public NumericSensorEntity MainHomeHumidity => new(_haContext, "sensor.main_home_humidity");
|
|
///<summary>Main Home Temperature</summary>
|
|
public NumericSensorEntity MainHomeTemperature => new(_haContext, "sensor.main_home_temperature");
|
|
///<summary>Marius Watch Battery level</summary>
|
|
public NumericSensorEntity MariusWatchBatteryLevel => new(_haContext, "sensor.marius_watch_battery_level");
|
|
///<summary>Marius Watch Battery temperature</summary>
|
|
public NumericSensorEntity MariusWatchBatteryTemperature => new(_haContext, "sensor.marius_watch_battery_temperature");
|
|
///<summary>Marius Watch Daily steps</summary>
|
|
public NumericSensorEntity MariusWatchDailySteps => new(_haContext, "sensor.marius_watch_daily_steps");
|
|
///<summary>Marius Watch Heart rate</summary>
|
|
public NumericSensorEntity MariusWatchHeartRate => new(_haContext, "sensor.marius_watch_heart_rate");
|
|
///<summary>Marius Watch Light sensor</summary>
|
|
public NumericSensorEntity MariusWatchLightSensor => new(_haContext, "sensor.marius_watch_light_sensor");
|
|
///<summary>Marius Watch Steps sensor</summary>
|
|
public NumericSensorEntity MariusWatchStepsSensor => new(_haContext, "sensor.marius_watch_steps_sensor");
|
|
///<summary>NetDaemon V6 (.NET 10) CPU percent</summary>
|
|
public NumericSensorEntity NetdaemonV6Net10CpuPercent => new(_haContext, "sensor.netdaemon_v6_net_10_cpu_percent");
|
|
///<summary>NetDaemon V6 (.NET 10) Memory percent</summary>
|
|
public NumericSensorEntity NetdaemonV6Net10MemoryPercent => new(_haContext, "sensor.netdaemon_v6_net_10_memory_percent");
|
|
///<summary>Nord Pool LT Current price</summary>
|
|
public NumericSensorEntity NordPoolLtCurrentPrice => new(_haContext, "sensor.nord_pool_lt_current_price");
|
|
///<summary>Nord Pool LT Daily average</summary>
|
|
public NumericSensorEntity NordPoolLtDailyAverage => new(_haContext, "sensor.nord_pool_lt_daily_average");
|
|
///<summary>Nord Pool LT Highest price</summary>
|
|
public NumericSensorEntity NordPoolLtHighestPrice => new(_haContext, "sensor.nord_pool_lt_highest_price");
|
|
///<summary>Nord Pool LT Lowest price</summary>
|
|
public NumericSensorEntity NordPoolLtLowestPrice => new(_haContext, "sensor.nord_pool_lt_lowest_price");
|
|
///<summary>NordPool NordPool current price</summary>
|
|
public NumericSensorEntity NordpoolCurrentPrice => new(_haContext, "sensor.nordpool_current_price");
|
|
///<summary>Nordpool price</summary>
|
|
public NumericSensorEntity NordpoolPrice => new(_haContext, "sensor.nordpool_price");
|
|
///<summary>System Monitor Disk free /</summary>
|
|
public NumericSensorEntity SystemMonitorDiskFree => new(_haContext, "sensor.system_monitor_disk_free");
|
|
///<summary>System Monitor Disk usage /</summary>
|
|
public NumericSensorEntity SystemMonitorDiskUsage => new(_haContext, "sensor.system_monitor_disk_usage");
|
|
///<summary>System Monitor Disk use /</summary>
|
|
public NumericSensorEntity SystemMonitorDiskUse => new(_haContext, "sensor.system_monitor_disk_use");
|
|
///<summary>System Monitor Memory usage</summary>
|
|
public NumericSensorEntity SystemMonitorMemoryUsage => new(_haContext, "sensor.system_monitor_memory_usage");
|
|
///<summary>System Monitor Network in end0</summary>
|
|
public NumericSensorEntity SystemMonitorNetworkInEnd0 => new(_haContext, "sensor.system_monitor_network_in_end0");
|
|
///<summary>System Monitor Network throughput in end0</summary>
|
|
public NumericSensorEntity SystemMonitorNetworkThroughputInEnd0 => new(_haContext, "sensor.system_monitor_network_throughput_in_end0");
|
|
///<summary>System Monitor Processor temperature</summary>
|
|
public NumericSensorEntity SystemMonitorProcessorTemperature => new(_haContext, "sensor.system_monitor_processor_temperature");
|
|
///<summary>System Monitor Processor use</summary>
|
|
public NumericSensorEntity SystemMonitorProcessorUse => new(_haContext, "sensor.system_monitor_processor_use");
|
|
///<summary>System Monitor Swap usage</summary>
|
|
public NumericSensorEntity SystemMonitorSwapUsage => new(_haContext, "sensor.system_monitor_swap_usage");
|
|
///<summary>Marius Phone Battery level</summary>
|
|
public NumericSensorEntity SmS936bBatteryLevel => new(_haContext, "sensor.sm_s936b_battery_level");
|
|
///<summary>Marius Phone Battery power</summary>
|
|
public NumericSensorEntity SmS936bBatteryPower => new(_haContext, "sensor.sm_s936b_battery_power");
|
|
///<summary>Marius Phone Battery temperature</summary>
|
|
public NumericSensorEntity SmS936bBatteryTemperature => new(_haContext, "sensor.sm_s936b_battery_temperature");
|
|
///<summary>Marius Phone Light sensor</summary>
|
|
public NumericSensorEntity SmS936bLightSensor => new(_haContext, "sensor.sm_s936b_light_sensor");
|
|
///<summary>Marius Phone Pressure sensor</summary>
|
|
public NumericSensorEntity SmS936bPressureSensor => new(_haContext, "sensor.sm_s936b_pressure_sensor");
|
|
///<summary>Marius Phone Remaining charge time</summary>
|
|
public NumericSensorEntity SmS936bRemainingChargeTime => new(_haContext, "sensor.sm_s936b_remaining_charge_time");
|
|
///<summary>Marius Phone Signal strength (SIM 1)</summary>
|
|
public NumericSensorEntity SmS936bSignalStrengthSim1 => new(_haContext, "sensor.sm_s936b_signal_strength_sim_1");
|
|
///<summary>Marius Phone Sleep confidence</summary>
|
|
public NumericSensorEntity SmS936bSleepConfidence => new(_haContext, "sensor.sm_s936b_sleep_confidence");
|
|
///<summary>Marius Phone Sleep segment</summary>
|
|
public NumericSensorEntity SmS936bSleepSegment => new(_haContext, "sensor.sm_s936b_sleep_segment");
|
|
///<summary>Marius Phone Steps sensor</summary>
|
|
public NumericSensorEntity SmS936bStepsSensor => new(_haContext, "sensor.sm_s936b_steps_sensor");
|
|
///<summary>Induction Power</summary>
|
|
public NumericSensorEntity Sonoff10018909cbPower => new(_haContext, "sensor.sonoff_10018909cb_power");
|
|
///<summary>Induction Voltage</summary>
|
|
public NumericSensorEntity Sonoff10018909cbVoltage => new(_haContext, "sensor.sonoff_10018909cb_voltage");
|
|
///<summary>AC Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100215c534EnergyDaySupply => new(_haContext, "sensor.sonoff_100215c534_energy_day_supply");
|
|
///<summary>AC Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100215c534EnergyMonthSupply => new(_haContext, "sensor.sonoff_100215c534_energy_month_supply");
|
|
///<summary>AC Power</summary>
|
|
public NumericSensorEntity Sonoff100215c534Power => new(_haContext, "sensor.sonoff_100215c534_power");
|
|
///<summary>AC Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100215c534PowerSupply => new(_haContext, "sensor.sonoff_100215c534_power_supply");
|
|
///<summary>AC Voltage</summary>
|
|
public NumericSensorEntity Sonoff100215c534Voltage => new(_haContext, "sensor.sonoff_100215c534_voltage");
|
|
///<summary>Lamp Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100222f7beEnergyDaySupply => new(_haContext, "sensor.sonoff_100222f7be_energy_day_supply");
|
|
///<summary>Lamp Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100222f7beEnergyMonthSupply => new(_haContext, "sensor.sonoff_100222f7be_energy_month_supply");
|
|
///<summary>Lamp Power</summary>
|
|
public NumericSensorEntity Sonoff100222f7bePower => new(_haContext, "sensor.sonoff_100222f7be_power");
|
|
///<summary>Lamp Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100222f7bePowerSupply => new(_haContext, "sensor.sonoff_100222f7be_power_supply");
|
|
///<summary>Christmas tree Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100222ff36EnergyDaySupply => new(_haContext, "sensor.sonoff_100222ff36_energy_day_supply");
|
|
///<summary>Christmas tree Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100222ff36EnergyMonthSupply => new(_haContext, "sensor.sonoff_100222ff36_energy_month_supply");
|
|
///<summary>Christmas tree Power</summary>
|
|
public NumericSensorEntity Sonoff100222ff36Power => new(_haContext, "sensor.sonoff_100222ff36_power");
|
|
///<summary>Christmas tree Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100222ff36PowerSupply => new(_haContext, "sensor.sonoff_100222ff36_power_supply");
|
|
///<summary>Christmas tree Voltage</summary>
|
|
public NumericSensorEntity Sonoff100222ff36Voltage => new(_haContext, "sensor.sonoff_100222ff36_voltage");
|
|
///<summary>Stair lamps Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100222ff63EnergyDaySupply => new(_haContext, "sensor.sonoff_100222ff63_energy_day_supply");
|
|
///<summary>Stair lamps Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100222ff63EnergyMonthSupply => new(_haContext, "sensor.sonoff_100222ff63_energy_month_supply");
|
|
///<summary>Stair lamps Power</summary>
|
|
public NumericSensorEntity Sonoff100222ff63Power => new(_haContext, "sensor.sonoff_100222ff63_power");
|
|
///<summary>Stair lamps Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100222ff63PowerSupply => new(_haContext, "sensor.sonoff_100222ff63_power_supply");
|
|
///<summary>Po laiptais Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff1002230a48EnergyDaySupply => new(_haContext, "sensor.sonoff_1002230a48_energy_day_supply");
|
|
///<summary>Po laiptais Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff1002230a48EnergyMonthSupply => new(_haContext, "sensor.sonoff_1002230a48_energy_month_supply");
|
|
///<summary>Po laiptais Power</summary>
|
|
public NumericSensorEntity Sonoff1002230a48Power => new(_haContext, "sensor.sonoff_1002230a48_power");
|
|
///<summary>Po laiptais Power Supply</summary>
|
|
public NumericSensorEntity Sonoff1002230a48PowerSupply => new(_haContext, "sensor.sonoff_1002230a48_power_supply");
|
|
///<summary>Po laiptais Voltage</summary>
|
|
public NumericSensorEntity Sonoff1002230a48Voltage => new(_haContext, "sensor.sonoff_1002230a48_voltage");
|
|
///<summary>Boiler Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff1002230e32EnergyDaySupply => new(_haContext, "sensor.sonoff_1002230e32_energy_day_supply");
|
|
///<summary>Boiler Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff1002230e32EnergyMonthSupply => new(_haContext, "sensor.sonoff_1002230e32_energy_month_supply");
|
|
///<summary>Boiler Power</summary>
|
|
public NumericSensorEntity Sonoff1002230e32Power => new(_haContext, "sensor.sonoff_1002230e32_power");
|
|
///<summary>Boiler Power Supply</summary>
|
|
public NumericSensorEntity Sonoff1002230e32PowerSupply => new(_haContext, "sensor.sonoff_1002230e32_power_supply");
|
|
///<summary>Boiler Voltage</summary>
|
|
public NumericSensorEntity Sonoff1002230e32Voltage => new(_haContext, "sensor.sonoff_1002230e32_voltage");
|
|
///<summary>Washer Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100255ead8EnergyDaySupply => new(_haContext, "sensor.sonoff_100255ead8_energy_day_supply");
|
|
///<summary>Washer Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100255ead8EnergyMonthSupply => new(_haContext, "sensor.sonoff_100255ead8_energy_month_supply");
|
|
///<summary>Washer Power</summary>
|
|
public NumericSensorEntity Sonoff100255ead8Power => new(_haContext, "sensor.sonoff_100255ead8_power");
|
|
///<summary>Washer Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100255ead8PowerSupply => new(_haContext, "sensor.sonoff_100255ead8_power_supply");
|
|
///<summary>Washer Voltage</summary>
|
|
public NumericSensorEntity Sonoff100255ead8Voltage => new(_haContext, "sensor.sonoff_100255ead8_voltage");
|
|
///<summary>Dryer Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100255f06cEnergyDaySupply => new(_haContext, "sensor.sonoff_100255f06c_energy_day_supply");
|
|
///<summary>Dryer Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100255f06cEnergyMonthSupply => new(_haContext, "sensor.sonoff_100255f06c_energy_month_supply");
|
|
///<summary>Dryer Power</summary>
|
|
public NumericSensorEntity Sonoff100255f06cPower => new(_haContext, "sensor.sonoff_100255f06c_power");
|
|
///<summary>Dryer Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100255f06cPowerSupply => new(_haContext, "sensor.sonoff_100255f06c_power_supply");
|
|
///<summary>Dryer Voltage</summary>
|
|
public NumericSensorEntity Sonoff100255f06cVoltage => new(_haContext, "sensor.sonoff_100255f06c_voltage");
|
|
///<summary>Cat Christmas lamps Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100255f738EnergyDaySupply => new(_haContext, "sensor.sonoff_100255f738_energy_day_supply");
|
|
///<summary>Cat Christmas lamps Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100255f738EnergyMonthSupply => new(_haContext, "sensor.sonoff_100255f738_energy_month_supply");
|
|
///<summary>Cat Christmas lamps Power</summary>
|
|
public NumericSensorEntity Sonoff100255f738Power => new(_haContext, "sensor.sonoff_100255f738_power");
|
|
///<summary>Cat Christmas lamps Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100255f738PowerSupply => new(_haContext, "sensor.sonoff_100255f738_power_supply");
|
|
///<summary>Dehumidifier Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff10025606e6EnergyDaySupply => new(_haContext, "sensor.sonoff_10025606e6_energy_day_supply");
|
|
///<summary>Dehumidifier Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff10025606e6EnergyMonthSupply => new(_haContext, "sensor.sonoff_10025606e6_energy_month_supply");
|
|
///<summary>Dehumidifier Power</summary>
|
|
public NumericSensorEntity Sonoff10025606e6Power => new(_haContext, "sensor.sonoff_10025606e6_power");
|
|
///<summary>Dehumidifier Power Supply</summary>
|
|
public NumericSensorEntity Sonoff10025606e6PowerSupply => new(_haContext, "sensor.sonoff_10025606e6_power_supply");
|
|
///<summary>Dehumidifier Voltage</summary>
|
|
public NumericSensorEntity Sonoff10025606e6Voltage => new(_haContext, "sensor.sonoff_10025606e6_voltage");
|
|
///<summary>Salt Lamp Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff10025609ceEnergyDaySupply => new(_haContext, "sensor.sonoff_10025609ce_energy_day_supply");
|
|
///<summary>Salt Lamp Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff10025609ceEnergyMonthSupply => new(_haContext, "sensor.sonoff_10025609ce_energy_month_supply");
|
|
///<summary>Salt Lamp Power</summary>
|
|
public NumericSensorEntity Sonoff10025609cePower => new(_haContext, "sensor.sonoff_10025609ce_power");
|
|
///<summary>Salt Lamp Power Supply</summary>
|
|
public NumericSensorEntity Sonoff10025609cePowerSupply => new(_haContext, "sensor.sonoff_10025609ce_power_supply");
|
|
///<summary>Salt Lamp Voltage</summary>
|
|
public NumericSensorEntity Sonoff10025609ceVoltage => new(_haContext, "sensor.sonoff_10025609ce_voltage");
|
|
///<summary>Home meter Current</summary>
|
|
public NumericSensorEntity Sonoff100267d63fCurrent => new(_haContext, "sensor.sonoff_100267d63f_current");
|
|
///<summary>Home meter Energy</summary>
|
|
public NumericSensorEntity Sonoff100267d63fEnergy => new(_haContext, "sensor.sonoff_100267d63f_energy");
|
|
///<summary>Home meter Energy Day</summary>
|
|
public NumericSensorEntity Sonoff100267d63fEnergyDay => new(_haContext, "sensor.sonoff_100267d63f_energy_day");
|
|
///<summary>Home meter Energy Day Supply</summary>
|
|
public NumericSensorEntity Sonoff100267d63fEnergyDaySupply => new(_haContext, "sensor.sonoff_100267d63f_energy_day_supply");
|
|
///<summary>Home meter Energy Month</summary>
|
|
public NumericSensorEntity Sonoff100267d63fEnergyMonth => new(_haContext, "sensor.sonoff_100267d63f_energy_month");
|
|
///<summary>Home meter Energy Month Supply</summary>
|
|
public NumericSensorEntity Sonoff100267d63fEnergyMonthSupply => new(_haContext, "sensor.sonoff_100267d63f_energy_month_supply");
|
|
///<summary>Total Home Power Usage</summary>
|
|
public NumericSensorEntity Sonoff100267d63fPower => new(_haContext, "sensor.sonoff_100267d63f_power");
|
|
///<summary>Home meter Power Supply</summary>
|
|
public NumericSensorEntity Sonoff100267d63fPowerSupply => new(_haContext, "sensor.sonoff_100267d63f_power_supply");
|
|
///<summary>Home meter Voltage</summary>
|
|
public NumericSensorEntity Sonoff100267d63fVoltage => new(_haContext, "sensor.sonoff_100267d63f_voltage");
|
|
///<summary>Outside Battery</summary>
|
|
public NumericSensorEntity SonoffA4800f07b4Battery => new(_haContext, "sensor.sonoff_a4800f07b4_battery");
|
|
///<summary>Outside Humidity</summary>
|
|
public NumericSensorEntity SonoffA4800f07b4Humidity => new(_haContext, "sensor.sonoff_a4800f07b4_humidity");
|
|
///<summary>Outside Temperature</summary>
|
|
public NumericSensorEntity SonoffA4800f07b4Temperature => new(_haContext, "sensor.sonoff_a4800f07b4_temperature");
|
|
///<summary>LED power Power</summary>
|
|
public NumericSensorEntity SonoffS60zbtpfPower => new(_haContext, "sensor.sonoff_s60zbtpf_power");
|
|
///<summary>Air Purifirier Power</summary>
|
|
public NumericSensorEntity SonoffS60zbtpfPower2 => new(_haContext, "sensor.sonoff_s60zbtpf_power_2");
|
|
///<summary>LED power Voltage</summary>
|
|
public NumericSensorEntity SonoffS60zbtpfVoltage => new(_haContext, "sensor.sonoff_s60zbtpf_voltage");
|
|
///<summary>Air Purifirier Voltage</summary>
|
|
public NumericSensorEntity SonoffS60zbtpfVoltage2 => new(_haContext, "sensor.sonoff_s60zbtpf_voltage_2");
|
|
///<summary>Network Infra Power</summary>
|
|
public NumericSensorEntity TempPower => new(_haContext, "sensor.temp_power");
|
|
///<summary>Network Infra Voltage</summary>
|
|
public NumericSensorEntity TempVoltage => new(_haContext, "sensor.temp_voltage");
|
|
///<summary>Total KWH</summary>
|
|
public NumericSensorEntity TotalKwh => new(_haContext, "sensor.total_kwh");
|
|
///<summary>Total sensors</summary>
|
|
public NumericSensorEntity TotalPower => new(_haContext, "sensor.total_power");
|
|
///<summary>TV Power</summary>
|
|
public NumericSensorEntity TvPower => new(_haContext, "sensor.tv_power");
|
|
///<summary>TV Voltage</summary>
|
|
public NumericSensorEntity TvVoltage => new(_haContext, "sensor.tv_voltage");
|
|
///<summary>Washing room Battery</summary>
|
|
public NumericSensorEntity WashingRoomBattery => new(_haContext, "sensor.washing_room_battery");
|
|
///<summary>Washing room Humidity</summary>
|
|
public NumericSensorEntity WashingRoomHumidity => new(_haContext, "sensor.washing_room_humidity");
|
|
///<summary>Washing room Temperature</summary>
|
|
public NumericSensorEntity WashingRoomTemperature => new(_haContext, "sensor.washing_room_temperature");
|
|
///<summary>eCO2</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Eco2 => new(_haContext, "sensor.wellbeing_air_purifier_2_eco2");
|
|
///<summary>Fresh 360 filter Life</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Filterlife => new(_haContext, "sensor.wellbeing_air_purifier_2_filterlife");
|
|
///<summary>Humidity</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Humidity => new(_haContext, "sensor.wellbeing_air_purifier_2_humidity");
|
|
///<summary>PM1</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Pm1 => new(_haContext, "sensor.wellbeing_air_purifier_2_pm1");
|
|
///<summary>PM10</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Pm10 => new(_haContext, "sensor.wellbeing_air_purifier_2_pm10");
|
|
///<summary>PM2.5</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Pm25 => new(_haContext, "sensor.wellbeing_air_purifier_2_pm2_5");
|
|
///<summary>Temperature</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Temp => new(_haContext, "sensor.wellbeing_air_purifier_2_temp");
|
|
///<summary>TVOC</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Tvoc => new(_haContext, "sensor.wellbeing_air_purifier_2_tvoc");
|
|
///<summary>Mode</summary>
|
|
public NumericSensorEntity WellbeingAirPurifier2Workmode => new(_haContext, "sensor.wellbeing_air_purifier_2_workmode");
|
|
}
|
|
|
|
public partial class SunEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SunEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all sun entities currently registered (at runtime) in Home Assistant as SunEntity</summary>
|
|
public IEnumerable<SunEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("sun.")).Select(e => new SunEntity(e));
|
|
///<summary>Sun</summary>
|
|
public SunEntity Sun => new(_haContext, "sun.sun");
|
|
}
|
|
|
|
public partial class SwitchEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SwitchEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all switch entities currently registered (at runtime) in Home Assistant as SwitchEntity</summary>
|
|
public IEnumerable<SwitchEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("switch.")).Select(e => new SwitchEntity(e));
|
|
///<summary>AC On/Off</summary>
|
|
public SwitchEntity AcOnOff => new(_haContext, "switch.ac_on_off");
|
|
///<summary>Akvariumas</summary>
|
|
public SwitchEntity Akvariumas => new(_haContext, "switch.akvariumas");
|
|
///<summary>3D print</summary>
|
|
public SwitchEntity BalkonyLaps => new(_haContext, "switch.balkony_laps");
|
|
///<summary>Boiler Monitor Override budget enforcement</summary>
|
|
public SwitchEntity BoilermonitorBudgetOverride => new(_haContext, "switch.boilermonitor_budget_override");
|
|
///<summary>Boiler Monitor Skip price cap, heat until ready</summary>
|
|
public SwitchEntity BoilermonitorSkipPriceCap => new(_haContext, "switch.boilermonitor_skip_price_cap");
|
|
///<summary>Dishwasher</summary>
|
|
public SwitchEntity Dishwasher => new(_haContext, "switch.dishwasher");
|
|
///<summary>Exhaust Fan</summary>
|
|
public SwitchEntity ExhaustFan => new(_haContext, "switch.exhaust_fan");
|
|
///<summary>Fridge</summary>
|
|
public SwitchEntity Fridge => new(_haContext, "switch.fridge");
|
|
///<summary>Heating Relay Far</summary>
|
|
public SwitchEntity Heating => new(_haContext, "switch.heating");
|
|
///<summary>Heating Relay Bathroom</summary>
|
|
public SwitchEntity Heating2 => new(_haContext, "switch.heating_2");
|
|
///<summary>Heating Relay Middle</summary>
|
|
public SwitchEntity Heating3 => new(_haContext, "switch.heating_3");
|
|
///<summary>Skip price cap, heat until ready</summary>
|
|
public SwitchEntity NordpoolBoilerSkipPriceCap => new(_haContext, "switch.nordpool_boiler_skip_price_cap");
|
|
///<summary>Induction</summary>
|
|
public SwitchEntity Sonoff10018909cb => new(_haContext, "switch.sonoff_10018909cb");
|
|
///<summary>AC</summary>
|
|
public SwitchEntity Sonoff100215c534 => new(_haContext, "switch.sonoff_100215c534");
|
|
///<summary>Plant Lamp</summary>
|
|
public SwitchEntity Sonoff100222f7be => new(_haContext, "switch.sonoff_100222f7be");
|
|
///<summary>Christmas tree</summary>
|
|
public SwitchEntity Sonoff100222ff36 => new(_haContext, "switch.sonoff_100222ff36");
|
|
///<summary>Stair lamps</summary>
|
|
public SwitchEntity Sonoff100222ff63 => new(_haContext, "switch.sonoff_100222ff63");
|
|
///<summary>Po laiptais</summary>
|
|
public SwitchEntity Sonoff1002230a48 => new(_haContext, "switch.sonoff_1002230a48");
|
|
///<summary>Boiler</summary>
|
|
public SwitchEntity Sonoff1002230e32 => new(_haContext, "switch.sonoff_1002230e32");
|
|
///<summary>Washer</summary>
|
|
public SwitchEntity Sonoff100255ead8 => new(_haContext, "switch.sonoff_100255ead8");
|
|
///<summary>Dryer</summary>
|
|
public SwitchEntity Sonoff100255f06c => new(_haContext, "switch.sonoff_100255f06c");
|
|
///<summary>Cat Christmas lamps</summary>
|
|
public SwitchEntity Sonoff100255f738 => new(_haContext, "switch.sonoff_100255f738");
|
|
///<summary>Dehumidifier</summary>
|
|
public SwitchEntity Sonoff10025606e6 => new(_haContext, "switch.sonoff_10025606e6");
|
|
///<summary>Salt Lamp</summary>
|
|
public SwitchEntity Sonoff10025609ce => new(_haContext, "switch.sonoff_10025609ce");
|
|
///<summary>LED power</summary>
|
|
public SwitchEntity SonoffS60zbtpf => new(_haContext, "switch.sonoff_s60zbtpf");
|
|
///<summary>Air Purifirier</summary>
|
|
public SwitchEntity SonoffS60zbtpf2 => new(_haContext, "switch.sonoff_s60zbtpf_2");
|
|
///<summary>Network Infra</summary>
|
|
public SwitchEntity Temp => new(_haContext, "switch.temp");
|
|
///<summary>TV</summary>
|
|
public SwitchEntity Tv => new(_haContext, "switch.tv");
|
|
///<summary>Ionizer</summary>
|
|
public SwitchEntity WellbeingAirPurifier2Ionizer => new(_haContext, "switch.wellbeing_air_purifier_2_ionizer");
|
|
///<summary>Safety Lock</summary>
|
|
public SwitchEntity WellbeingAirPurifier2Safetylock => new(_haContext, "switch.wellbeing_air_purifier_2_safetylock");
|
|
///<summary>UI Light</summary>
|
|
public SwitchEntity WellbeingAirPurifier2Uilight => new(_haContext, "switch.wellbeing_air_purifier_2_uilight");
|
|
}
|
|
|
|
public partial class TextEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public TextEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all text entities currently registered (at runtime) in Home Assistant as TextEntity</summary>
|
|
public IEnumerable<TextEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("text.")).Select(e => new TextEntity(e));
|
|
///<summary>Boiler Monitor Boiler power entity ID</summary>
|
|
public TextEntity BoilermonitorConfigPowerEntityId => new(_haContext, "text.boilermonitor_config_power_entity_id");
|
|
///<summary>Boiler Monitor Boiler switch entity ID</summary>
|
|
public TextEntity BoilermonitorConfigSwitchEntityId => new(_haContext, "text.boilermonitor_config_switch_entity_id");
|
|
}
|
|
|
|
public partial class TtsEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public TtsEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all tts entities currently registered (at runtime) in Home Assistant as TtsEntity</summary>
|
|
public IEnumerable<TtsEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("tts.")).Select(e => new TtsEntity(e));
|
|
///<summary>Google Translate en com</summary>
|
|
public TtsEntity GoogleTranslateEnCom => new(_haContext, "tts.google_translate_en_com");
|
|
}
|
|
|
|
public partial class UpdateEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public UpdateEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all update entities currently registered (at runtime) in Home Assistant as UpdateEntity</summary>
|
|
public IEnumerable<UpdateEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("update.")).Select(e => new UpdateEntity(e));
|
|
///<summary>Advanced SSH & Web Terminal Update</summary>
|
|
public UpdateEntity AdvancedSshWebTerminalUpdate => new(_haContext, "update.advanced_ssh_web_terminal_update");
|
|
///<summary>Akvariumas Firmware</summary>
|
|
public UpdateEntity AkvariumasFirmware => new(_haContext, "update.akvariumas_firmware");
|
|
///<summary>apexcharts-card update</summary>
|
|
public UpdateEntity ApexchartsCardUpdate => new(_haContext, "update.apexcharts_card_update");
|
|
///<summary>Aquarium leak sensor Firmware</summary>
|
|
public UpdateEntity AquariumLeakSensorFirmware => new(_haContext, "update.aquarium_leak_sensor_firmware");
|
|
///<summary>3D print Firmware</summary>
|
|
public UpdateEntity BalkonyLapsFirmware => new(_haContext, "update.balkony_laps_firmware");
|
|
///<summary>Bathroom Firmware</summary>
|
|
public UpdateEntity BathroomFirmware => new(_haContext, "update.bathroom_firmware");
|
|
///<summary>Bedroom Firmware</summary>
|
|
public UpdateEntity BedroomFirmware => new(_haContext, "update.bedroom_firmware");
|
|
///<summary>Boiler Moisture Firmware</summary>
|
|
public UpdateEntity BoilerMoistureFirmware => new(_haContext, "update.boiler_moisture_firmware");
|
|
///<summary>Boiler room Temp Firmware</summary>
|
|
public UpdateEntity BoilerTempFirmware => new(_haContext, "update.boiler_temp_firmware");
|
|
///<summary>Cat Area Temp Firmware</summary>
|
|
public UpdateEntity CatAreaTempFirmware => new(_haContext, "update.cat_area_temp_firmware");
|
|
///<summary>Dishwasher Firmware</summary>
|
|
public UpdateEntity DishwasherFirmware => new(_haContext, "update.dishwasher_firmware");
|
|
///<summary>Electrolux Wellbeing update</summary>
|
|
public UpdateEntity ElectroluxWellbeingUpdate => new(_haContext, "update.electrolux_wellbeing_update");
|
|
///<summary>Exhaust Fan Firmware</summary>
|
|
public UpdateEntity ExhaustFanFirmware => new(_haContext, "update.exhaust_fan_firmware");
|
|
///<summary>Fridge Firmware</summary>
|
|
public UpdateEntity FridgeFirmware => new(_haContext, "update.fridge_firmware");
|
|
///<summary>Get HACS Update</summary>
|
|
public UpdateEntity GetHacsUpdate => new(_haContext, "update.get_hacs_update");
|
|
///<summary>HACS update</summary>
|
|
public UpdateEntity HacsUpdate => new(_haContext, "update.hacs_update");
|
|
///<summary>Heating Relay Far Firmware</summary>
|
|
public UpdateEntity HeatingFirmware => new(_haContext, "update.heating_firmware");
|
|
///<summary>Heating Relay Bathroom Firmware</summary>
|
|
public UpdateEntity HeatingFirmware2 => new(_haContext, "update.heating_firmware_2");
|
|
///<summary>Heating Relay Middle Firmware</summary>
|
|
public UpdateEntity HeatingFirmware3 => new(_haContext, "update.heating_firmware_3");
|
|
///<summary>Home Assistant Core Update</summary>
|
|
public UpdateEntity HomeAssistantCoreUpdate => new(_haContext, "update.home_assistant_core_update");
|
|
///<summary>Home Assistant Operating System Update</summary>
|
|
public UpdateEntity HomeAssistantOperatingSystemUpdate => new(_haContext, "update.home_assistant_operating_system_update");
|
|
///<summary>Home Assistant Supervisor Update</summary>
|
|
public UpdateEntity HomeAssistantSupervisorUpdate => new(_haContext, "update.home_assistant_supervisor_update");
|
|
///<summary>Let's Encrypt Update</summary>
|
|
public UpdateEntity LetSEncryptUpdate => new(_haContext, "update.let_s_encrypt_update");
|
|
///<summary>Local Tuya update</summary>
|
|
public UpdateEntity LocalTuyaUpdate => new(_haContext, "update.local_tuya_update");
|
|
///<summary>Main Home Firmware</summary>
|
|
public UpdateEntity MainHomeFirmware => new(_haContext, "update.main_home_firmware");
|
|
///<summary>mini-graph-card update</summary>
|
|
public UpdateEntity MiniGraphCardUpdate => new(_haContext, "update.mini_graph_card_update");
|
|
///<summary>Modern Circular Gauge update</summary>
|
|
public UpdateEntity ModernCircularGaugeUpdate => new(_haContext, "update.modern_circular_gauge_update");
|
|
///<summary>Mosquitto broker Update</summary>
|
|
public UpdateEntity MosquittoBrokerUpdate => new(_haContext, "update.mosquitto_broker_update");
|
|
///<summary>NetDaemon V6 (.NET 10) Update</summary>
|
|
public UpdateEntity NetdaemonV6Net10Update => new(_haContext, "update.netdaemon_v6_net_10_update");
|
|
///<summary>Nginx Proxy Manager Update</summary>
|
|
public UpdateEntity NginxProxyManagerUpdate => new(_haContext, "update.nginx_proxy_manager_update");
|
|
///<summary>Samba share Update</summary>
|
|
public UpdateEntity SambaShareUpdate => new(_haContext, "update.samba_share_update");
|
|
///<summary>Sonoff LAN update</summary>
|
|
public UpdateEntity SonoffLanUpdate => new(_haContext, "update.sonoff_lan_update");
|
|
///<summary>LED power Firmware</summary>
|
|
public UpdateEntity SonoffS60zbtpfFirmware => new(_haContext, "update.sonoff_s60zbtpf_firmware");
|
|
///<summary>Air Purifirier Firmware</summary>
|
|
public UpdateEntity SonoffS60zbtpfFirmware2 => new(_haContext, "update.sonoff_s60zbtpf_firmware_2");
|
|
///<summary>Spook 👻 Your homie update</summary>
|
|
public UpdateEntity SpookYourHomieUpdate => new(_haContext, "update.spook_your_homie_update");
|
|
///<summary>Studio Code Server Update</summary>
|
|
public UpdateEntity StudioCodeServerUpdate => new(_haContext, "update.studio_code_server_update");
|
|
///<summary>Network Infra Firmware</summary>
|
|
public UpdateEntity TempFirmware => new(_haContext, "update.temp_firmware");
|
|
///<summary>Tibber Graph update</summary>
|
|
public UpdateEntity TibberGraphUpdate => new(_haContext, "update.tibber_graph_update");
|
|
///<summary>TV Firmware</summary>
|
|
public UpdateEntity TvFirmware => new(_haContext, "update.tv_firmware");
|
|
///<summary>UniFi Network Application Update</summary>
|
|
public UpdateEntity UnifiNetworkApplicationUpdate => new(_haContext, "update.unifi_network_application_update");
|
|
///<summary>Vaultwarden Update</summary>
|
|
public UpdateEntity VaultwardenBitwardenUpdate => new(_haContext, "update.vaultwarden_bitwarden_update");
|
|
///<summary>Washing room Firmware</summary>
|
|
public UpdateEntity WashingRoomFirmware => new(_haContext, "update.washing_room_firmware");
|
|
///<summary>🧰 ZHA Toolkit - Service for advanced Zigbee Usage update</summary>
|
|
public UpdateEntity ZhaToolkitServiceForAdvancedZigbeeUsageUpdate => new(_haContext, "update.zha_toolkit_service_for_advanced_zigbee_usage_update");
|
|
}
|
|
|
|
public partial class WeatherEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public WeatherEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all weather entities currently registered (at runtime) in Home Assistant as WeatherEntity</summary>
|
|
public IEnumerable<WeatherEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("weather.")).Select(e => new WeatherEntity(e));
|
|
///<summary>Kaunas (Žaliakalnis)</summary>
|
|
public WeatherEntity KaunasZaliakalnis => new(_haContext, "weather.kaunas_zaliakalnis");
|
|
}
|
|
|
|
public partial class ZoneEntities
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ZoneEntities(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
/// <summary>Enumerates all zone entities currently registered (at runtime) in Home Assistant as ZoneEntity</summary>
|
|
public IEnumerable<ZoneEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("zone.")).Select(e => new ZoneEntity(e));
|
|
///<summary>Home</summary>
|
|
public ZoneEntity Home => new(_haContext, "zone.home");
|
|
}
|
|
|
|
public partial record LightEntity : Entity<LightEntity, EntityState<LightAttributes>, LightAttributes>, ILightEntityCore
|
|
{
|
|
public LightEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public LightEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record LightAttributes
|
|
{
|
|
[JsonPropertyName("supported_color_modes")]
|
|
public IReadOnlyList<string>? SupportedColorModes { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
|
|
[JsonPropertyName("color_mode")]
|
|
public string? ColorMode { get; init; }
|
|
|
|
[JsonPropertyName("min_color_temp_kelvin")]
|
|
public double? MinColorTempKelvin { get; init; }
|
|
|
|
[JsonPropertyName("max_color_temp_kelvin")]
|
|
public double? MaxColorTempKelvin { get; init; }
|
|
|
|
[JsonPropertyName("min_mireds")]
|
|
public double? MinMireds { get; init; }
|
|
|
|
[JsonPropertyName("max_mireds")]
|
|
public double? MaxMireds { get; init; }
|
|
|
|
[JsonPropertyName("brightness")]
|
|
public double? Brightness { get; init; }
|
|
|
|
[JsonPropertyName("color_temp_kelvin")]
|
|
public double? ColorTempKelvin { get; init; }
|
|
|
|
[JsonPropertyName("color_temp")]
|
|
public double? ColorTemp { get; init; }
|
|
|
|
[JsonPropertyName("hs_color")]
|
|
public IReadOnlyList<double>? HsColor { get; init; }
|
|
|
|
[JsonPropertyName("rgb_color")]
|
|
public IReadOnlyList<double>? RgbColor { get; init; }
|
|
|
|
[JsonPropertyName("xy_color")]
|
|
public IReadOnlyList<double>? XyColor { get; init; }
|
|
|
|
[JsonPropertyName("entity_id")]
|
|
public IReadOnlyList<string>? EntityId { get; init; }
|
|
|
|
[JsonPropertyName("effect_list")]
|
|
public IReadOnlyList<string>? EffectList { get; init; }
|
|
|
|
[JsonPropertyName("color")]
|
|
public object? Color { get; init; }
|
|
|
|
[JsonPropertyName("effect")]
|
|
public object? Effect { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerEntity : Entity<MediaPlayerEntity, EntityState<MediaPlayerAttributes>, MediaPlayerAttributes>, IMediaPlayerEntityCore
|
|
{
|
|
public MediaPlayerEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public MediaPlayerEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record MediaPlayerAttributes
|
|
{
|
|
[JsonPropertyName("app_id")]
|
|
public string? AppId { get; init; }
|
|
|
|
[JsonPropertyName("app_name")]
|
|
public string? AppName { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
|
|
[JsonPropertyName("entity_picture_local")]
|
|
public string? EntityPictureLocal { get; init; }
|
|
|
|
[JsonPropertyName("entity_picture")]
|
|
public string? EntityPicture { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
|
|
[JsonPropertyName("volume_level")]
|
|
public double? VolumeLevel { get; init; }
|
|
|
|
[JsonPropertyName("is_volume_muted")]
|
|
public bool? IsVolumeMuted { get; init; }
|
|
|
|
[JsonPropertyName("media_content_id")]
|
|
public string? MediaContentId { get; init; }
|
|
|
|
[JsonPropertyName("media_content_type")]
|
|
public string? MediaContentType { get; init; }
|
|
|
|
[JsonPropertyName("media_duration")]
|
|
public double? MediaDuration { get; init; }
|
|
|
|
[JsonPropertyName("media_position")]
|
|
public double? MediaPosition { get; init; }
|
|
|
|
[JsonPropertyName("media_position_updated_at")]
|
|
public string? MediaPositionUpdatedAt { get; init; }
|
|
|
|
[JsonPropertyName("media_title")]
|
|
public string? MediaTitle { get; init; }
|
|
|
|
[JsonPropertyName("media_album_name")]
|
|
public string? MediaAlbumName { get; init; }
|
|
|
|
[JsonPropertyName("media_image_url")]
|
|
public string? MediaImageUrl { get; init; }
|
|
|
|
[JsonPropertyName("media_artist")]
|
|
public string? MediaArtist { get; init; }
|
|
|
|
[JsonPropertyName("sound_mode_list")]
|
|
public IReadOnlyList<string>? SoundModeList { get; init; }
|
|
|
|
[JsonPropertyName("media_track")]
|
|
public object? MediaTrack { get; init; }
|
|
|
|
[JsonPropertyName("shuffle")]
|
|
public bool? Shuffle { get; init; }
|
|
|
|
[JsonPropertyName("repeat")]
|
|
public string? Repeat { get; init; }
|
|
|
|
[JsonPropertyName("source_list")]
|
|
public IReadOnlyList<string>? SourceList { get; init; }
|
|
|
|
[JsonPropertyName("source")]
|
|
public string? Source { get; init; }
|
|
|
|
[JsonPropertyName("adb_response")]
|
|
public object? AdbResponse { get; init; }
|
|
|
|
[JsonPropertyName("hdmi_input")]
|
|
public object? HdmiInput { get; init; }
|
|
|
|
[JsonPropertyName("sound_mode")]
|
|
public string? SoundMode { get; init; }
|
|
|
|
[JsonPropertyName("sound_mode_raw")]
|
|
public string? SoundModeRaw { get; init; }
|
|
|
|
[JsonPropertyName("restored")]
|
|
public bool? Restored { get; init; }
|
|
}
|
|
|
|
public partial record AutomationEntity : Entity<AutomationEntity, EntityState<AutomationAttributes>, AutomationAttributes>, IAutomationEntityCore
|
|
{
|
|
public AutomationEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public AutomationEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record AutomationAttributes
|
|
{
|
|
[JsonPropertyName("id")]
|
|
public string? Id { get; init; }
|
|
|
|
[JsonPropertyName("last_triggered")]
|
|
public string? LastTriggered { get; init; }
|
|
|
|
[JsonPropertyName("mode")]
|
|
public string? Mode { get; init; }
|
|
|
|
[JsonPropertyName("current")]
|
|
public double? Current { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record BinarySensorEntity : Entity<BinarySensorEntity, EntityState<BinarySensorAttributes>, BinarySensorAttributes>, IBinarySensorEntityCore
|
|
{
|
|
public BinarySensorEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public BinarySensorEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record BinarySensorAttributes
|
|
{
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
|
|
[JsonPropertyName("hysteresis")]
|
|
public double? Hysteresis { get; init; }
|
|
|
|
[JsonPropertyName("lower")]
|
|
public double? Lower { get; init; }
|
|
|
|
[JsonPropertyName("position")]
|
|
public string? Position { get; init; }
|
|
|
|
[JsonPropertyName("sensor_value")]
|
|
public double? SensorValue { get; init; }
|
|
|
|
[JsonPropertyName("type")]
|
|
public string? Type { get; init; }
|
|
|
|
[JsonPropertyName("upper")]
|
|
public double? Upper { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("integration")]
|
|
public string? Integration { get; init; }
|
|
|
|
[JsonPropertyName("capabilities")]
|
|
public IReadOnlyList<string>? Capabilities { get; init; }
|
|
}
|
|
|
|
public partial record ButtonEntity : Entity<ButtonEntity, EntityState<ButtonAttributes>, ButtonAttributes>, IButtonEntityCore
|
|
{
|
|
public ButtonEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public ButtonEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record ButtonAttributes
|
|
{
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
}
|
|
|
|
public partial record ClimateEntity : Entity<ClimateEntity, EntityState<ClimateAttributes>, ClimateAttributes>, IClimateEntityCore
|
|
{
|
|
public ClimateEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public ClimateEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record ClimateAttributes
|
|
{
|
|
[JsonPropertyName("hvac_modes")]
|
|
public IReadOnlyList<string>? HvacModes { get; init; }
|
|
|
|
[JsonPropertyName("min_temp")]
|
|
public double? MinTemp { get; init; }
|
|
|
|
[JsonPropertyName("max_temp")]
|
|
public double? MaxTemp { get; init; }
|
|
|
|
[JsonPropertyName("target_temp_step")]
|
|
public double? TargetTempStep { get; init; }
|
|
|
|
[JsonPropertyName("current_temperature")]
|
|
public double? CurrentTemperature { get; init; }
|
|
|
|
[JsonPropertyName("temperature")]
|
|
public double? Temperature { get; init; }
|
|
|
|
[JsonPropertyName("hvac_action")]
|
|
public string? HvacAction { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
|
|
[JsonPropertyName("current_humidity")]
|
|
public double? CurrentHumidity { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
}
|
|
|
|
public partial record ConversationEntity : Entity<ConversationEntity, EntityState<ConversationAttributes>, ConversationAttributes>
|
|
{
|
|
public ConversationEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public ConversationEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record ConversationAttributes
|
|
{
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
}
|
|
|
|
public partial record CounterEntity : Entity<CounterEntity, EntityState<CounterAttributes>, CounterAttributes>
|
|
{
|
|
public CounterEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public CounterEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record CounterAttributes
|
|
{
|
|
[JsonPropertyName("editable")]
|
|
public bool? Editable { get; init; }
|
|
|
|
[JsonPropertyName("initial")]
|
|
public double? Initial { get; init; }
|
|
|
|
[JsonPropertyName("step")]
|
|
public double? Step { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record DeviceTrackerEntity : Entity<DeviceTrackerEntity, EntityState<DeviceTrackerAttributes>, DeviceTrackerAttributes>, IDeviceTrackerEntityCore
|
|
{
|
|
public DeviceTrackerEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public DeviceTrackerEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record DeviceTrackerAttributes
|
|
{
|
|
[JsonPropertyName("source_type")]
|
|
public string? SourceType { get; init; }
|
|
|
|
[JsonPropertyName("latitude")]
|
|
public double? Latitude { get; init; }
|
|
|
|
[JsonPropertyName("longitude")]
|
|
public double? Longitude { get; init; }
|
|
|
|
[JsonPropertyName("gps_accuracy")]
|
|
public double? GpsAccuracy { get; init; }
|
|
|
|
[JsonPropertyName("altitude")]
|
|
public double? Altitude { get; init; }
|
|
|
|
[JsonPropertyName("course")]
|
|
public double? Course { get; init; }
|
|
|
|
[JsonPropertyName("speed")]
|
|
public double? Speed { get; init; }
|
|
|
|
[JsonPropertyName("vertical_accuracy")]
|
|
public double? VerticalAccuracy { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("battery_level")]
|
|
public double? BatteryLevel { get; init; }
|
|
}
|
|
|
|
public partial record EventEntity : Entity<EventEntity, EntityState<EventAttributes>, EventAttributes>
|
|
{
|
|
public EventEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public EventEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record EventAttributes
|
|
{
|
|
[JsonPropertyName("event_types")]
|
|
public IReadOnlyList<string>? EventTypes { get; init; }
|
|
|
|
[JsonPropertyName("event_type")]
|
|
public string? EventType { get; init; }
|
|
|
|
[JsonPropertyName("domain")]
|
|
public string? Domain { get; init; }
|
|
|
|
[JsonPropertyName("issue_id")]
|
|
public string? IssueId { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record FanEntity : Entity<FanEntity, EntityState<FanAttributes>, FanAttributes>
|
|
{
|
|
public FanEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public FanEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record FanAttributes
|
|
{
|
|
[JsonPropertyName("preset_modes")]
|
|
public IReadOnlyList<string>? PresetModes { get; init; }
|
|
|
|
[JsonPropertyName("percentage")]
|
|
public double? Percentage { get; init; }
|
|
|
|
[JsonPropertyName("percentage_step")]
|
|
public double? PercentageStep { get; init; }
|
|
|
|
[JsonPropertyName("preset_mode")]
|
|
public string? PresetMode { get; init; }
|
|
|
|
[JsonPropertyName("integration")]
|
|
public string? Integration { get; init; }
|
|
|
|
[JsonPropertyName("capabilities")]
|
|
public IReadOnlyList<string>? Capabilities { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
}
|
|
|
|
public partial record HumidifierEntity : Entity<HumidifierEntity, EntityState<HumidifierAttributes>, HumidifierAttributes>
|
|
{
|
|
public HumidifierEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public HumidifierEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record HumidifierAttributes
|
|
{
|
|
[JsonPropertyName("min_humidity")]
|
|
public double? MinHumidity { get; init; }
|
|
|
|
[JsonPropertyName("max_humidity")]
|
|
public double? MaxHumidity { get; init; }
|
|
|
|
[JsonPropertyName("action")]
|
|
public string? Action { get; init; }
|
|
|
|
[JsonPropertyName("current_humidity")]
|
|
public double? CurrentHumidity { get; init; }
|
|
|
|
[JsonPropertyName("humidity")]
|
|
public double? Humidity { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
}
|
|
|
|
public partial record InputBooleanEntity : Entity<InputBooleanEntity, EntityState<InputBooleanAttributes>, InputBooleanAttributes>, IInputBooleanEntityCore
|
|
{
|
|
public InputBooleanEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public InputBooleanEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record InputBooleanAttributes
|
|
{
|
|
[JsonPropertyName("editable")]
|
|
public bool? Editable { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record InputDatetimeEntity : Entity<InputDatetimeEntity, EntityState<InputDatetimeAttributes>, InputDatetimeAttributes>, IInputDatetimeEntityCore
|
|
{
|
|
public InputDatetimeEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public InputDatetimeEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record InputDatetimeAttributes
|
|
{
|
|
[JsonPropertyName("has_date")]
|
|
public bool? HasDate { get; init; }
|
|
|
|
[JsonPropertyName("has_time")]
|
|
public bool? HasTime { get; init; }
|
|
|
|
[JsonPropertyName("editable")]
|
|
public bool? Editable { get; init; }
|
|
|
|
[JsonPropertyName("hour")]
|
|
public double? Hour { get; init; }
|
|
|
|
[JsonPropertyName("minute")]
|
|
public double? Minute { get; init; }
|
|
|
|
[JsonPropertyName("second")]
|
|
public double? Second { get; init; }
|
|
|
|
[JsonPropertyName("timestamp")]
|
|
public double? Timestamp { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record InputNumberEntity : NumericEntity<InputNumberEntity, NumericEntityState<InputNumberAttributes>, InputNumberAttributes>, IInputNumberEntityCore
|
|
{
|
|
public InputNumberEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public InputNumberEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record InputNumberAttributes
|
|
{
|
|
[JsonPropertyName("initial")]
|
|
public object? Initial { get; init; }
|
|
|
|
[JsonPropertyName("editable")]
|
|
public bool? Editable { get; init; }
|
|
|
|
[JsonPropertyName("min")]
|
|
public double? Min { get; init; }
|
|
|
|
[JsonPropertyName("max")]
|
|
public double? Max { get; init; }
|
|
|
|
[JsonPropertyName("step")]
|
|
public double? Step { get; init; }
|
|
|
|
[JsonPropertyName("mode")]
|
|
public string? Mode { get; init; }
|
|
|
|
[JsonPropertyName("unit_of_measurement")]
|
|
public string? UnitOfMeasurement { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record NumberEntity : NumericEntity<NumberEntity, NumericEntityState<NumberAttributes>, NumberAttributes>, INumberEntityCore
|
|
{
|
|
public NumberEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public NumberEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record NumberAttributes
|
|
{
|
|
[JsonPropertyName("min")]
|
|
public double? Min { get; init; }
|
|
|
|
[JsonPropertyName("max")]
|
|
public double? Max { get; init; }
|
|
|
|
[JsonPropertyName("step")]
|
|
public double? Step { get; init; }
|
|
|
|
[JsonPropertyName("mode")]
|
|
public string? Mode { get; init; }
|
|
|
|
[JsonPropertyName("unit_of_measurement")]
|
|
public string? UnitOfMeasurement { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
}
|
|
|
|
public partial record PersonEntity : Entity<PersonEntity, EntityState<PersonAttributes>, PersonAttributes>, IPersonEntityCore
|
|
{
|
|
public PersonEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public PersonEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record PersonAttributes
|
|
{
|
|
[JsonPropertyName("editable")]
|
|
public bool? Editable { get; init; }
|
|
|
|
[JsonPropertyName("id")]
|
|
public string? Id { get; init; }
|
|
|
|
[JsonPropertyName("device_trackers")]
|
|
public IReadOnlyList<string>? DeviceTrackers { get; init; }
|
|
|
|
[JsonPropertyName("latitude")]
|
|
public double? Latitude { get; init; }
|
|
|
|
[JsonPropertyName("longitude")]
|
|
public double? Longitude { get; init; }
|
|
|
|
[JsonPropertyName("gps_accuracy")]
|
|
public double? GpsAccuracy { get; init; }
|
|
|
|
[JsonPropertyName("source")]
|
|
public string? Source { get; init; }
|
|
|
|
[JsonPropertyName("user_id")]
|
|
public string? UserId { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record RemoteEntity : Entity<RemoteEntity, EntityState<RemoteAttributes>, RemoteAttributes>, IRemoteEntityCore
|
|
{
|
|
public RemoteEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public RemoteEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record RemoteAttributes
|
|
{
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
|
|
[JsonPropertyName("restored")]
|
|
public bool? Restored { get; init; }
|
|
}
|
|
|
|
public partial record ScriptEntity : Entity<ScriptEntity, EntityState<ScriptAttributes>, ScriptAttributes>, IScriptEntityCore
|
|
{
|
|
public ScriptEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public ScriptEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record ScriptAttributes
|
|
{
|
|
[JsonPropertyName("last_triggered")]
|
|
public string? LastTriggered { get; init; }
|
|
|
|
[JsonPropertyName("mode")]
|
|
public string? Mode { get; init; }
|
|
|
|
[JsonPropertyName("current")]
|
|
public double? Current { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
}
|
|
|
|
public partial record SelectEntity : Entity<SelectEntity, EntityState<SelectAttributes>, SelectAttributes>, ISelectEntityCore
|
|
{
|
|
public SelectEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public SelectEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record SelectAttributes
|
|
{
|
|
[JsonPropertyName("options")]
|
|
public IReadOnlyList<string>? Options { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record SensorEntity : Entity<SensorEntity, EntityState<SensorAttributes>, SensorAttributes>, ISensorEntityCore
|
|
{
|
|
public SensorEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public SensorEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record SensorAttributes
|
|
{
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("options")]
|
|
public IReadOnlyList<string>? Options { get; init; }
|
|
|
|
[JsonPropertyName("still")]
|
|
public double? Still { get; init; }
|
|
|
|
[JsonPropertyName("unknown")]
|
|
public double? Unknown { get; init; }
|
|
|
|
[JsonPropertyName("administrative_area")]
|
|
public string? AdministrativeArea_0 { get; init; }
|
|
|
|
[JsonPropertyName("Administrative Area")]
|
|
public string? AdministrativeArea_1 { get; init; }
|
|
|
|
[JsonPropertyName("country")]
|
|
public string? Country_0 { get; init; }
|
|
|
|
[JsonPropertyName("Country")]
|
|
public string? Country_1 { get; init; }
|
|
|
|
[JsonPropertyName("iso_country_code")]
|
|
public string? IsoCountryCode { get; init; }
|
|
|
|
[JsonPropertyName("locality")]
|
|
public string? Locality_0 { get; init; }
|
|
|
|
[JsonPropertyName("Locality")]
|
|
public string? Locality_1 { get; init; }
|
|
|
|
[JsonPropertyName("location")]
|
|
public IReadOnlyList<double>? Location_0 { get; init; }
|
|
|
|
[JsonPropertyName("Location")]
|
|
public IReadOnlyList<double>? Location_1 { get; init; }
|
|
|
|
[JsonPropertyName("name")]
|
|
public string? Name_0 { get; init; }
|
|
|
|
[JsonPropertyName("Name")]
|
|
public string? Name_1 { get; init; }
|
|
|
|
[JsonPropertyName("phone")]
|
|
public string? Phone { get; init; }
|
|
|
|
[JsonPropertyName("postal_code")]
|
|
public string? PostalCode_0 { get; init; }
|
|
|
|
[JsonPropertyName("Postal Code")]
|
|
public string? PostalCode_1 { get; init; }
|
|
|
|
[JsonPropertyName("premises")]
|
|
public string? Premises { get; init; }
|
|
|
|
[JsonPropertyName("sub_administrative_area")]
|
|
public string? SubAdministrativeArea_0 { get; init; }
|
|
|
|
[JsonPropertyName("Sub Administrative Area")]
|
|
public string? SubAdministrativeArea_1 { get; init; }
|
|
|
|
[JsonPropertyName("sub_locality")]
|
|
public string? SubLocality_0 { get; init; }
|
|
|
|
[JsonPropertyName("Sub Locality")]
|
|
public string? SubLocality_1 { get; init; }
|
|
|
|
[JsonPropertyName("sub_thoroughfare")]
|
|
public string? SubThoroughfare_0 { get; init; }
|
|
|
|
[JsonPropertyName("Sub Thoroughfare")]
|
|
public string? SubThoroughfare_1 { get; init; }
|
|
|
|
[JsonPropertyName("thoroughfare")]
|
|
public string? Thoroughfare_0 { get; init; }
|
|
|
|
[JsonPropertyName("Thoroughfare")]
|
|
public string? Thoroughfare_1 { get; init; }
|
|
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; init; }
|
|
|
|
[JsonPropertyName("is_hidden")]
|
|
public bool? IsHidden { get; init; }
|
|
|
|
[JsonPropertyName("metered")]
|
|
public bool? Metered { get; init; }
|
|
|
|
[JsonPropertyName("carrier id")]
|
|
public double? Carrierid { get; init; }
|
|
|
|
[JsonPropertyName("carrier name")]
|
|
public string? Carriername { get; init; }
|
|
|
|
[JsonPropertyName("data roaming")]
|
|
public string? Dataroaming { get; init; }
|
|
|
|
[JsonPropertyName("is opportunistic")]
|
|
public bool? Isopportunistic { get; init; }
|
|
|
|
[JsonPropertyName("iso country code")]
|
|
public string? Isocountrycode { get; init; }
|
|
|
|
[JsonPropertyName("mcc")]
|
|
public string? Mcc { get; init; }
|
|
|
|
[JsonPropertyName("mnc")]
|
|
public string? Mnc { get; init; }
|
|
|
|
[JsonPropertyName("Low Power Mode")]
|
|
public bool? LowPowerMode { get; init; }
|
|
|
|
[JsonPropertyName("Areas Of Interest")]
|
|
public string? AreasOfInterest { get; init; }
|
|
|
|
[JsonPropertyName("Inland Water")]
|
|
public string? InlandWater { get; init; }
|
|
|
|
[JsonPropertyName("ISO Country Code")]
|
|
public string? ISOCountryCode { get; init; }
|
|
|
|
[JsonPropertyName("Ocean")]
|
|
public string? Ocean { get; init; }
|
|
|
|
[JsonPropertyName("Time Zone")]
|
|
public string? TimeZone { get; init; }
|
|
|
|
[JsonPropertyName("Zones")]
|
|
public IReadOnlyList<string>? Zones { get; init; }
|
|
|
|
[JsonPropertyName("exercise_type")]
|
|
public string? ExerciseType { get; init; }
|
|
|
|
[JsonPropertyName("time")]
|
|
public string? Time { get; init; }
|
|
|
|
[JsonPropertyName("state_class")]
|
|
public string? StateClass { get; init; }
|
|
|
|
[JsonPropertyName("attribution")]
|
|
public string? Attribution { get; init; }
|
|
|
|
[JsonPropertyName("prices")]
|
|
public IReadOnlyList<IReadOnlyList<double>>? Prices { get; init; }
|
|
|
|
[JsonPropertyName("last_updated")]
|
|
public string? LastUpdated { get; init; }
|
|
|
|
[JsonPropertyName("prices_count")]
|
|
public double? PricesCount { get; init; }
|
|
|
|
[JsonPropertyName("intervals")]
|
|
public IReadOnlyList<object>? Intervals { get; init; }
|
|
|
|
[JsonPropertyName("configured_hours")]
|
|
public double? ConfiguredHours { get; init; }
|
|
|
|
[JsonPropertyName("configured_interval_count")]
|
|
public double? ConfiguredIntervalCount { get; init; }
|
|
|
|
[JsonPropertyName("configured_price_cap")]
|
|
public double? ConfiguredPriceCap { get; init; }
|
|
|
|
[JsonPropertyName("skip_price_cap")]
|
|
public bool? SkipPriceCap { get; init; }
|
|
|
|
[JsonPropertyName("configured_ready_by")]
|
|
public string? ConfiguredReadyBy { get; init; }
|
|
|
|
[JsonPropertyName("total_heating_minutes")]
|
|
public double? TotalHeatingMinutes { get; init; }
|
|
|
|
[JsonPropertyName("is_now_cheap")]
|
|
public bool? IsNowCheap { get; init; }
|
|
|
|
[JsonPropertyName("next_cheap_interval")]
|
|
public object? NextCheapInterval { get; init; }
|
|
|
|
[JsonPropertyName("boiler_switch_state")]
|
|
public string? BoilerSwitchState { get; init; }
|
|
|
|
[JsonPropertyName("boiler_power_watts")]
|
|
public double? BoilerPowerWatts { get; init; }
|
|
|
|
[JsonPropertyName("power_threshold_watts")]
|
|
public double? PowerThresholdWatts { get; init; }
|
|
}
|
|
|
|
public partial record NumericSensorEntity : NumericEntity<NumericSensorEntity, NumericEntityState<NumericSensorAttributes>, NumericSensorAttributes>, ISensorEntityCore
|
|
{
|
|
public NumericSensorEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public NumericSensorEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record NumericSensorAttributes
|
|
{
|
|
[JsonPropertyName("state_class")]
|
|
public string? StateClass { get; init; }
|
|
|
|
[JsonPropertyName("unit_of_measurement")]
|
|
public string? UnitOfMeasurement { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("raw_state")]
|
|
public double? RawState { get; init; }
|
|
|
|
[JsonPropertyName("light")]
|
|
public double? Light { get; init; }
|
|
|
|
[JsonPropertyName("motion")]
|
|
public double? Motion { get; init; }
|
|
|
|
[JsonPropertyName("timestamp")]
|
|
public double? Timestamp { get; init; }
|
|
|
|
[JsonPropertyName("end")]
|
|
public object? End { get; init; }
|
|
|
|
[JsonPropertyName("start")]
|
|
public object? Start { get; init; }
|
|
|
|
[JsonPropertyName("status")]
|
|
public string? Status { get; init; }
|
|
|
|
[JsonPropertyName("current")]
|
|
public double? Current { get; init; }
|
|
|
|
[JsonPropertyName("voltage")]
|
|
public double? Voltage { get; init; }
|
|
|
|
[JsonPropertyName("asu")]
|
|
public double? Asu { get; init; }
|
|
|
|
[JsonPropertyName("quality")]
|
|
public string? Quality { get; init; }
|
|
|
|
[JsonPropertyName("accuracy")]
|
|
public string? Accuracy { get; init; }
|
|
|
|
[JsonPropertyName("entity_id")]
|
|
public IReadOnlyList<string>? EntityId { get; init; }
|
|
|
|
[JsonPropertyName("attribution")]
|
|
public string? Attribution { get; init; }
|
|
|
|
[JsonPropertyName("source")]
|
|
public string? Source { get; init; }
|
|
|
|
[JsonPropertyName("integration")]
|
|
public string? Integration { get; init; }
|
|
|
|
[JsonPropertyName("capabilities")]
|
|
public IReadOnlyList<string>? Capabilities { get; init; }
|
|
|
|
[JsonPropertyName("last_updated")]
|
|
public string? LastUpdated { get; init; }
|
|
|
|
[JsonPropertyName("last_api_fetch")]
|
|
public string? LastApiFetch { get; init; }
|
|
|
|
[JsonPropertyName("using_cached_data")]
|
|
public bool? UsingCachedData { get; init; }
|
|
|
|
[JsonPropertyName("current_quarter_index")]
|
|
public double? CurrentQuarterIndex { get; init; }
|
|
|
|
[JsonPropertyName("formatted")]
|
|
public string? Formatted { get; init; }
|
|
|
|
[JsonPropertyName("budget_hours")]
|
|
public double? BudgetHours { get; init; }
|
|
|
|
[JsonPropertyName("measurement_type")]
|
|
public string? MeasurementType { get; init; }
|
|
|
|
[JsonPropertyName("battery_voltage")]
|
|
public double? BatteryVoltage { get; init; }
|
|
|
|
[JsonPropertyName("restored")]
|
|
public bool? Restored { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
}
|
|
|
|
public partial record SunEntity : Entity<SunEntity, EntityState<SunAttributes>, SunAttributes>, ISunEntityCore
|
|
{
|
|
public SunEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public SunEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record SunAttributes
|
|
{
|
|
[JsonPropertyName("next_dawn")]
|
|
public string? NextDawn { get; init; }
|
|
|
|
[JsonPropertyName("next_dusk")]
|
|
public string? NextDusk { get; init; }
|
|
|
|
[JsonPropertyName("next_midnight")]
|
|
public string? NextMidnight { get; init; }
|
|
|
|
[JsonPropertyName("next_noon")]
|
|
public string? NextNoon { get; init; }
|
|
|
|
[JsonPropertyName("next_rising")]
|
|
public string? NextRising { get; init; }
|
|
|
|
[JsonPropertyName("next_setting")]
|
|
public string? NextSetting { get; init; }
|
|
|
|
[JsonPropertyName("elevation")]
|
|
public double? Elevation { get; init; }
|
|
|
|
[JsonPropertyName("azimuth")]
|
|
public double? Azimuth { get; init; }
|
|
|
|
[JsonPropertyName("rising")]
|
|
public bool? Rising { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record SwitchEntity : Entity<SwitchEntity, EntityState<SwitchAttributes>, SwitchAttributes>, ISwitchEntityCore
|
|
{
|
|
public SwitchEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public SwitchEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record SwitchAttributes
|
|
{
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("current")]
|
|
public bool? Current { get; init; }
|
|
|
|
[JsonPropertyName("raw_state")]
|
|
public bool? RawState { get; init; }
|
|
|
|
[JsonPropertyName("integration")]
|
|
public string? Integration { get; init; }
|
|
|
|
[JsonPropertyName("capabilities")]
|
|
public IReadOnlyList<string>? Capabilities { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
|
|
[JsonPropertyName("assumed_state")]
|
|
public bool? AssumedState { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
}
|
|
|
|
public partial record TextEntity : Entity<TextEntity, EntityState<TextAttributes>, TextAttributes>
|
|
{
|
|
public TextEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public TextEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record TextAttributes
|
|
{
|
|
[JsonPropertyName("mode")]
|
|
public string? Mode { get; init; }
|
|
|
|
[JsonPropertyName("min")]
|
|
public double? Min { get; init; }
|
|
|
|
[JsonPropertyName("max")]
|
|
public double? Max { get; init; }
|
|
|
|
[JsonPropertyName("pattern")]
|
|
public object? Pattern { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record TtsEntity : Entity<TtsEntity, EntityState<TtsAttributes>, TtsAttributes>
|
|
{
|
|
public TtsEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public TtsEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record TtsAttributes
|
|
{
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public partial record UpdateEntity : Entity<UpdateEntity, EntityState<UpdateAttributes>, UpdateAttributes>, IUpdateEntityCore
|
|
{
|
|
public UpdateEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public UpdateEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record UpdateAttributes
|
|
{
|
|
[JsonPropertyName("auto_update")]
|
|
public bool? AutoUpdate { get; init; }
|
|
|
|
[JsonPropertyName("display_precision")]
|
|
public double? DisplayPrecision { get; init; }
|
|
|
|
[JsonPropertyName("installed_version")]
|
|
public string? InstalledVersion { get; init; }
|
|
|
|
[JsonPropertyName("in_progress")]
|
|
public bool? InProgress { get; init; }
|
|
|
|
[JsonPropertyName("latest_version")]
|
|
public string? LatestVersion { get; init; }
|
|
|
|
[JsonPropertyName("release_summary")]
|
|
public object? ReleaseSummary { get; init; }
|
|
|
|
[JsonPropertyName("release_url")]
|
|
public string? ReleaseUrl { get; init; }
|
|
|
|
[JsonPropertyName("skipped_version")]
|
|
public object? SkippedVersion { get; init; }
|
|
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
[JsonPropertyName("update_percentage")]
|
|
public object? UpdatePercentage { get; init; }
|
|
|
|
[JsonPropertyName("entity_picture")]
|
|
public string? EntityPicture { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
|
|
[JsonPropertyName("device_class")]
|
|
public string? DeviceClass { get; init; }
|
|
}
|
|
|
|
public partial record WeatherEntity : Entity<WeatherEntity, EntityState<WeatherAttributes>, WeatherAttributes>, IWeatherEntityCore
|
|
{
|
|
public WeatherEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public WeatherEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record WeatherAttributes
|
|
{
|
|
[JsonPropertyName("temperature")]
|
|
public double? Temperature { get; init; }
|
|
|
|
[JsonPropertyName("apparent_temperature")]
|
|
public double? ApparentTemperature { get; init; }
|
|
|
|
[JsonPropertyName("temperature_unit")]
|
|
public string? TemperatureUnit { get; init; }
|
|
|
|
[JsonPropertyName("humidity")]
|
|
public double? Humidity { get; init; }
|
|
|
|
[JsonPropertyName("cloud_coverage")]
|
|
public double? CloudCoverage { get; init; }
|
|
|
|
[JsonPropertyName("pressure")]
|
|
public double? Pressure { get; init; }
|
|
|
|
[JsonPropertyName("pressure_unit")]
|
|
public string? PressureUnit { get; init; }
|
|
|
|
[JsonPropertyName("wind_bearing")]
|
|
public double? WindBearing { get; init; }
|
|
|
|
[JsonPropertyName("wind_gust_speed")]
|
|
public double? WindGustSpeed { get; init; }
|
|
|
|
[JsonPropertyName("wind_speed")]
|
|
public double? WindSpeed { get; init; }
|
|
|
|
[JsonPropertyName("wind_speed_unit")]
|
|
public string? WindSpeedUnit { get; init; }
|
|
|
|
[JsonPropertyName("visibility_unit")]
|
|
public string? VisibilityUnit { get; init; }
|
|
|
|
[JsonPropertyName("precipitation_unit")]
|
|
public string? PrecipitationUnit { get; init; }
|
|
|
|
[JsonPropertyName("attribution")]
|
|
public string? Attribution { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
|
|
[JsonPropertyName("supported_features")]
|
|
public double? SupportedFeatures { get; init; }
|
|
}
|
|
|
|
public partial record ZoneEntity : Entity<ZoneEntity, EntityState<ZoneAttributes>, ZoneAttributes>, IZoneEntityCore
|
|
{
|
|
public ZoneEntity(IHaContext haContext, string entityId) : base(haContext, entityId)
|
|
{
|
|
}
|
|
|
|
public ZoneEntity(IEntityCore entity) : base(entity)
|
|
{
|
|
}
|
|
}
|
|
|
|
public partial record ZoneAttributes
|
|
{
|
|
[JsonPropertyName("latitude")]
|
|
public double? Latitude { get; init; }
|
|
|
|
[JsonPropertyName("longitude")]
|
|
public double? Longitude { get; init; }
|
|
|
|
[JsonPropertyName("radius")]
|
|
public double? Radius { get; init; }
|
|
|
|
[JsonPropertyName("passive")]
|
|
public bool? Passive { get; init; }
|
|
|
|
[JsonPropertyName("persons")]
|
|
public IReadOnlyList<string>? Persons { get; init; }
|
|
|
|
[JsonPropertyName("editable")]
|
|
public bool? Editable { get; init; }
|
|
|
|
[JsonPropertyName("icon")]
|
|
public string? Icon { get; init; }
|
|
|
|
[JsonPropertyName("friendly_name")]
|
|
public string? FriendlyName { get; init; }
|
|
}
|
|
|
|
public interface IServices
|
|
{
|
|
AlarmControlPanelServices AlarmControlPanel { get; }
|
|
|
|
AutomationServices Automation { get; }
|
|
|
|
BackupServices Backup { get; }
|
|
|
|
BlueprintServices Blueprint { get; }
|
|
|
|
ButtonServices Button { get; }
|
|
|
|
CameraServices Camera { get; }
|
|
|
|
ClimateServices Climate { get; }
|
|
|
|
CloudServices Cloud { get; }
|
|
|
|
ConversationServices Conversation { get; }
|
|
|
|
CounterServices Counter { get; }
|
|
|
|
CoverServices Cover { get; }
|
|
|
|
DeviceTrackerServices DeviceTracker { get; }
|
|
|
|
FanServices Fan { get; }
|
|
|
|
FfmpegServices Ffmpeg { get; }
|
|
|
|
FileServices File { get; }
|
|
|
|
FrontendServices Frontend { get; }
|
|
|
|
HassioServices Hassio { get; }
|
|
|
|
HomeassistantServices Homeassistant { get; }
|
|
|
|
HumidifierServices Humidifier { get; }
|
|
|
|
InputBooleanServices InputBoolean { get; }
|
|
|
|
InputButtonServices InputButton { get; }
|
|
|
|
InputDatetimeServices InputDatetime { get; }
|
|
|
|
InputNumberServices InputNumber { get; }
|
|
|
|
InputSelectServices InputSelect { get; }
|
|
|
|
InputTextServices InputText { get; }
|
|
|
|
LightServices Light { get; }
|
|
|
|
LocaltuyaServices Localtuya { get; }
|
|
|
|
LockServices Lock { get; }
|
|
|
|
LogbookServices Logbook { get; }
|
|
|
|
LoggerServices Logger { get; }
|
|
|
|
MediaPlayerServices MediaPlayer { get; }
|
|
|
|
MqttServices Mqtt { get; }
|
|
|
|
NordpoolServices Nordpool { get; }
|
|
|
|
NotifyServices Notify { get; }
|
|
|
|
NumberServices Number { get; }
|
|
|
|
PersistentNotificationServices PersistentNotification { get; }
|
|
|
|
PersonServices Person { get; }
|
|
|
|
RecorderServices Recorder { get; }
|
|
|
|
RemoteServices Remote { get; }
|
|
|
|
RepairsServices Repairs { get; }
|
|
|
|
SceneServices Scene { get; }
|
|
|
|
ScheduleServices Schedule { get; }
|
|
|
|
ScriptServices Script { get; }
|
|
|
|
SelectServices Select { get; }
|
|
|
|
SirenServices Siren { get; }
|
|
|
|
SystemLogServices SystemLog { get; }
|
|
|
|
SonoffServices Sonoff { get; }
|
|
|
|
SpookServices Spook { get; }
|
|
|
|
SwitchServices Switch { get; }
|
|
|
|
TemplateServices Template { get; }
|
|
|
|
TextServices Text { get; }
|
|
|
|
TimeServices Time { get; }
|
|
|
|
TimerServices Timer { get; }
|
|
|
|
TtsServices Tts { get; }
|
|
|
|
UpdateServices Update { get; }
|
|
|
|
VacuumServices Vacuum { get; }
|
|
|
|
ValveServices Valve { get; }
|
|
|
|
WeatherServices Weather { get; }
|
|
|
|
ZhaServices Zha { get; }
|
|
|
|
ZhaToolkitServices ZhaToolkit { get; }
|
|
|
|
ZoneServices Zone { get; }
|
|
}
|
|
|
|
public partial class Services : IServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public Services(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public AlarmControlPanelServices AlarmControlPanel => new(_haContext);
|
|
public AutomationServices Automation => new(_haContext);
|
|
public BackupServices Backup => new(_haContext);
|
|
public BlueprintServices Blueprint => new(_haContext);
|
|
public ButtonServices Button => new(_haContext);
|
|
public CameraServices Camera => new(_haContext);
|
|
public ClimateServices Climate => new(_haContext);
|
|
public CloudServices Cloud => new(_haContext);
|
|
public ConversationServices Conversation => new(_haContext);
|
|
public CounterServices Counter => new(_haContext);
|
|
public CoverServices Cover => new(_haContext);
|
|
public DeviceTrackerServices DeviceTracker => new(_haContext);
|
|
public FanServices Fan => new(_haContext);
|
|
public FfmpegServices Ffmpeg => new(_haContext);
|
|
public FileServices File => new(_haContext);
|
|
public FrontendServices Frontend => new(_haContext);
|
|
public HassioServices Hassio => new(_haContext);
|
|
public HomeassistantServices Homeassistant => new(_haContext);
|
|
public HumidifierServices Humidifier => new(_haContext);
|
|
public InputBooleanServices InputBoolean => new(_haContext);
|
|
public InputButtonServices InputButton => new(_haContext);
|
|
public InputDatetimeServices InputDatetime => new(_haContext);
|
|
public InputNumberServices InputNumber => new(_haContext);
|
|
public InputSelectServices InputSelect => new(_haContext);
|
|
public InputTextServices InputText => new(_haContext);
|
|
public LightServices Light => new(_haContext);
|
|
public LocaltuyaServices Localtuya => new(_haContext);
|
|
public LockServices Lock => new(_haContext);
|
|
public LogbookServices Logbook => new(_haContext);
|
|
public LoggerServices Logger => new(_haContext);
|
|
public MediaPlayerServices MediaPlayer => new(_haContext);
|
|
public MqttServices Mqtt => new(_haContext);
|
|
public NordpoolServices Nordpool => new(_haContext);
|
|
public NotifyServices Notify => new(_haContext);
|
|
public NumberServices Number => new(_haContext);
|
|
public PersistentNotificationServices PersistentNotification => new(_haContext);
|
|
public PersonServices Person => new(_haContext);
|
|
public RecorderServices Recorder => new(_haContext);
|
|
public RemoteServices Remote => new(_haContext);
|
|
public RepairsServices Repairs => new(_haContext);
|
|
public SceneServices Scene => new(_haContext);
|
|
public ScheduleServices Schedule => new(_haContext);
|
|
public ScriptServices Script => new(_haContext);
|
|
public SelectServices Select => new(_haContext);
|
|
public SirenServices Siren => new(_haContext);
|
|
public SystemLogServices SystemLog => new(_haContext);
|
|
public SonoffServices Sonoff => new(_haContext);
|
|
public SpookServices Spook => new(_haContext);
|
|
public SwitchServices Switch => new(_haContext);
|
|
public TemplateServices Template => new(_haContext);
|
|
public TextServices Text => new(_haContext);
|
|
public TimeServices Time => new(_haContext);
|
|
public TimerServices Timer => new(_haContext);
|
|
public TtsServices Tts => new(_haContext);
|
|
public UpdateServices Update => new(_haContext);
|
|
public VacuumServices Vacuum => new(_haContext);
|
|
public ValveServices Valve => new(_haContext);
|
|
public WeatherServices Weather => new(_haContext);
|
|
public ZhaServices Zha => new(_haContext);
|
|
public ZhaToolkitServices ZhaToolkit => new(_haContext);
|
|
public ZoneServices Zone => new(_haContext);
|
|
}
|
|
|
|
public partial class AlarmControlPanelServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public AlarmControlPanelServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void AlarmArmAway(ServiceTarget target, AlarmControlPanelAlarmArmAwayParameters data)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_away", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void AlarmArmAway(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_away", target, new AlarmControlPanelAlarmArmAwayParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void AlarmArmCustomBypass(ServiceTarget target, AlarmControlPanelAlarmArmCustomBypassParameters data)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_custom_bypass", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void AlarmArmCustomBypass(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_custom_bypass", target, new AlarmControlPanelAlarmArmCustomBypassParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void AlarmArmHome(ServiceTarget target, AlarmControlPanelAlarmArmHomeParameters data)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_home", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void AlarmArmHome(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_home", target, new AlarmControlPanelAlarmArmHomeParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void AlarmArmNight(ServiceTarget target, AlarmControlPanelAlarmArmNightParameters data)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_night", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void AlarmArmNight(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_night", target, new AlarmControlPanelAlarmArmNightParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void AlarmArmVacation(ServiceTarget target, AlarmControlPanelAlarmArmVacationParameters data)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_vacation", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void AlarmArmVacation(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_arm_vacation", target, new AlarmControlPanelAlarmArmVacationParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void AlarmDisarm(ServiceTarget target, AlarmControlPanelAlarmDisarmParameters data)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_disarm", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void AlarmDisarm(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_disarm", target, new AlarmControlPanelAlarmDisarmParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void AlarmTrigger(ServiceTarget target, AlarmControlPanelAlarmTriggerParameters data)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_trigger", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void AlarmTrigger(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("alarm_control_panel", "alarm_trigger", target, new AlarmControlPanelAlarmTriggerParameters { Code = code });
|
|
}
|
|
}
|
|
|
|
public partial record AlarmControlPanelAlarmArmAwayParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record AlarmControlPanelAlarmArmCustomBypassParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record AlarmControlPanelAlarmArmHomeParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record AlarmControlPanelAlarmArmNightParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record AlarmControlPanelAlarmArmVacationParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record AlarmControlPanelAlarmDisarmParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record AlarmControlPanelAlarmTriggerParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial class AutomationServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public AutomationServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("automation", "reload", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("automation", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Trigger(ServiceTarget target, AutomationTriggerParameters data)
|
|
{
|
|
_haContext.CallService("automation", "trigger", target, data);
|
|
}
|
|
|
|
///<param name="skipCondition"></param>
|
|
public void Trigger(ServiceTarget target, bool? skipCondition = null)
|
|
{
|
|
_haContext.CallService("automation", "trigger", target, new AutomationTriggerParameters { SkipCondition = skipCondition });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, AutomationTurnOffParameters data)
|
|
{
|
|
_haContext.CallService("automation", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="stopActions"></param>
|
|
public void TurnOff(ServiceTarget target, bool? stopActions = null)
|
|
{
|
|
_haContext.CallService("automation", "turn_off", target, new AutomationTurnOffParameters { StopActions = stopActions });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("automation", "turn_on", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record AutomationTriggerParameters
|
|
{
|
|
[JsonPropertyName("skip_condition")]
|
|
public bool? SkipCondition { get; init; }
|
|
}
|
|
|
|
public partial record AutomationTurnOffParameters
|
|
{
|
|
[JsonPropertyName("stop_actions")]
|
|
public bool? StopActions { get; init; }
|
|
}
|
|
|
|
public partial class BackupServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public BackupServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void CreateAutomatic(object? data = null)
|
|
{
|
|
_haContext.CallService("backup", "create_automatic", null, data);
|
|
}
|
|
}
|
|
|
|
public partial class BlueprintServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public BlueprintServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Import a blueprint.</summary>
|
|
public void Import(BlueprintImportParameters data)
|
|
{
|
|
_haContext.CallService("blueprint", "import", null, data);
|
|
}
|
|
|
|
///<summary>Import a blueprint.</summary>
|
|
///<param name="url">The URL to import the blueprint from.</param>
|
|
public void Import(string url)
|
|
{
|
|
_haContext.CallService("blueprint", "import", null, new BlueprintImportParameters { Url = url });
|
|
}
|
|
}
|
|
|
|
public partial record BlueprintImportParameters
|
|
{
|
|
///<summary>The URL to import the blueprint from.</summary>
|
|
[JsonPropertyName("url")]
|
|
public string? Url { get; init; }
|
|
}
|
|
|
|
public partial class ButtonServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ButtonServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Press(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("button", "press", target, data);
|
|
}
|
|
}
|
|
|
|
public partial class CameraServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public CameraServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void DisableMotionDetection(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("camera", "disable_motion_detection", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void EnableMotionDetection(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("camera", "enable_motion_detection", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void PlayStream(ServiceTarget target, CameraPlayStreamParameters data)
|
|
{
|
|
_haContext.CallService("camera", "play_stream", target, data);
|
|
}
|
|
|
|
///<param name="mediaPlayer"></param>
|
|
///<param name="format"></param>
|
|
public void PlayStream(ServiceTarget target, string mediaPlayer, object? format = null)
|
|
{
|
|
_haContext.CallService("camera", "play_stream", target, new CameraPlayStreamParameters { MediaPlayer = mediaPlayer, Format = format });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Record(ServiceTarget target, CameraRecordParameters data)
|
|
{
|
|
_haContext.CallService("camera", "record", target, data);
|
|
}
|
|
|
|
///<param name="filename"> eg: /tmp/snapshot_{{ entity_id.name }}.mp4</param>
|
|
///<param name="duration"></param>
|
|
///<param name="lookback"></param>
|
|
public void Record(ServiceTarget target, string filename, long? duration = null, long? lookback = null)
|
|
{
|
|
_haContext.CallService("camera", "record", target, new CameraRecordParameters { Filename = filename, Duration = duration, Lookback = lookback });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Snapshot(ServiceTarget target, CameraSnapshotParameters data)
|
|
{
|
|
_haContext.CallService("camera", "snapshot", target, data);
|
|
}
|
|
|
|
///<param name="filename"> eg: /tmp/snapshot_{{ entity_id.name }}.jpg</param>
|
|
public void Snapshot(ServiceTarget target, string filename)
|
|
{
|
|
_haContext.CallService("camera", "snapshot", target, new CameraSnapshotParameters { Filename = filename });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("camera", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("camera", "turn_on", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record CameraPlayStreamParameters
|
|
{
|
|
[JsonPropertyName("media_player")]
|
|
public string? MediaPlayer { get; init; }
|
|
|
|
[JsonPropertyName("format")]
|
|
public object? Format { get; init; }
|
|
}
|
|
|
|
public partial record CameraRecordParameters
|
|
{
|
|
///<summary> eg: /tmp/snapshot_{{ entity_id.name }}.mp4</summary>
|
|
[JsonPropertyName("filename")]
|
|
public string? Filename { get; init; }
|
|
|
|
[JsonPropertyName("duration")]
|
|
public long? Duration { get; init; }
|
|
|
|
[JsonPropertyName("lookback")]
|
|
public long? Lookback { get; init; }
|
|
}
|
|
|
|
public partial record CameraSnapshotParameters
|
|
{
|
|
///<summary> eg: /tmp/snapshot_{{ entity_id.name }}.jpg</summary>
|
|
[JsonPropertyName("filename")]
|
|
public string? Filename { get; init; }
|
|
}
|
|
|
|
public partial class ClimateServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ClimateServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetFanMode(ServiceTarget target, ClimateSetFanModeParameters data)
|
|
{
|
|
_haContext.CallService("climate", "set_fan_mode", target, data);
|
|
}
|
|
|
|
///<param name="fanMode"> eg: low</param>
|
|
public void SetFanMode(ServiceTarget target, string fanMode)
|
|
{
|
|
_haContext.CallService("climate", "set_fan_mode", target, new ClimateSetFanModeParameters { FanMode = fanMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetHumidity(ServiceTarget target, ClimateSetHumidityParameters data)
|
|
{
|
|
_haContext.CallService("climate", "set_humidity", target, data);
|
|
}
|
|
|
|
///<param name="humidity"></param>
|
|
public void SetHumidity(ServiceTarget target, long humidity)
|
|
{
|
|
_haContext.CallService("climate", "set_humidity", target, new ClimateSetHumidityParameters { Humidity = humidity });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetHvacMode(ServiceTarget target, ClimateSetHvacModeParameters data)
|
|
{
|
|
_haContext.CallService("climate", "set_hvac_mode", target, data);
|
|
}
|
|
|
|
///<param name="hvacMode"></param>
|
|
public void SetHvacMode(ServiceTarget target, object? hvacMode = null)
|
|
{
|
|
_haContext.CallService("climate", "set_hvac_mode", target, new ClimateSetHvacModeParameters { HvacMode = hvacMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetPresetMode(ServiceTarget target, ClimateSetPresetModeParameters data)
|
|
{
|
|
_haContext.CallService("climate", "set_preset_mode", target, data);
|
|
}
|
|
|
|
///<param name="presetMode"> eg: away</param>
|
|
public void SetPresetMode(ServiceTarget target, string presetMode)
|
|
{
|
|
_haContext.CallService("climate", "set_preset_mode", target, new ClimateSetPresetModeParameters { PresetMode = presetMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetSwingHorizontalMode(ServiceTarget target, ClimateSetSwingHorizontalModeParameters data)
|
|
{
|
|
_haContext.CallService("climate", "set_swing_horizontal_mode", target, data);
|
|
}
|
|
|
|
///<param name="swingHorizontalMode"> eg: on</param>
|
|
public void SetSwingHorizontalMode(ServiceTarget target, string swingHorizontalMode)
|
|
{
|
|
_haContext.CallService("climate", "set_swing_horizontal_mode", target, new ClimateSetSwingHorizontalModeParameters { SwingHorizontalMode = swingHorizontalMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetSwingMode(ServiceTarget target, ClimateSetSwingModeParameters data)
|
|
{
|
|
_haContext.CallService("climate", "set_swing_mode", target, data);
|
|
}
|
|
|
|
///<param name="swingMode"> eg: on</param>
|
|
public void SetSwingMode(ServiceTarget target, string swingMode)
|
|
{
|
|
_haContext.CallService("climate", "set_swing_mode", target, new ClimateSetSwingModeParameters { SwingMode = swingMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetTemperature(ServiceTarget target, ClimateSetTemperatureParameters data)
|
|
{
|
|
_haContext.CallService("climate", "set_temperature", target, data);
|
|
}
|
|
|
|
///<param name="temperature"></param>
|
|
///<param name="targetTempHigh"></param>
|
|
///<param name="targetTempLow"></param>
|
|
///<param name="hvacMode"></param>
|
|
public void SetTemperature(ServiceTarget target, double? temperature = null, double? targetTempHigh = null, double? targetTempLow = null, object? hvacMode = null)
|
|
{
|
|
_haContext.CallService("climate", "set_temperature", target, new ClimateSetTemperatureParameters { Temperature = temperature, TargetTempHigh = targetTempHigh, TargetTempLow = targetTempLow, HvacMode = hvacMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("climate", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("climate", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("climate", "turn_on", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record ClimateSetFanModeParameters
|
|
{
|
|
///<summary> eg: low</summary>
|
|
[JsonPropertyName("fan_mode")]
|
|
public string? FanMode { get; init; }
|
|
}
|
|
|
|
public partial record ClimateSetHumidityParameters
|
|
{
|
|
[JsonPropertyName("humidity")]
|
|
public long? Humidity { get; init; }
|
|
}
|
|
|
|
public partial record ClimateSetHvacModeParameters
|
|
{
|
|
[JsonPropertyName("hvac_mode")]
|
|
public object? HvacMode { get; init; }
|
|
}
|
|
|
|
public partial record ClimateSetPresetModeParameters
|
|
{
|
|
///<summary> eg: away</summary>
|
|
[JsonPropertyName("preset_mode")]
|
|
public string? PresetMode { get; init; }
|
|
}
|
|
|
|
public partial record ClimateSetSwingHorizontalModeParameters
|
|
{
|
|
///<summary> eg: on</summary>
|
|
[JsonPropertyName("swing_horizontal_mode")]
|
|
public string? SwingHorizontalMode { get; init; }
|
|
}
|
|
|
|
public partial record ClimateSetSwingModeParameters
|
|
{
|
|
///<summary> eg: on</summary>
|
|
[JsonPropertyName("swing_mode")]
|
|
public string? SwingMode { get; init; }
|
|
}
|
|
|
|
public partial record ClimateSetTemperatureParameters
|
|
{
|
|
[JsonPropertyName("temperature")]
|
|
public double? Temperature { get; init; }
|
|
|
|
[JsonPropertyName("target_temp_high")]
|
|
public double? TargetTempHigh { get; init; }
|
|
|
|
[JsonPropertyName("target_temp_low")]
|
|
public double? TargetTempLow { get; init; }
|
|
|
|
[JsonPropertyName("hvac_mode")]
|
|
public object? HvacMode { get; init; }
|
|
}
|
|
|
|
public partial class CloudServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public CloudServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void RemoteConnect(object? data = null)
|
|
{
|
|
_haContext.CallService("cloud", "remote_connect", null, data);
|
|
}
|
|
|
|
public void RemoteDisconnect(object? data = null)
|
|
{
|
|
_haContext.CallService("cloud", "remote_disconnect", null, data);
|
|
}
|
|
}
|
|
|
|
public partial class ConversationServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ConversationServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Process(ConversationProcessParameters data)
|
|
{
|
|
_haContext.CallService("conversation", "process", null, data);
|
|
}
|
|
|
|
///<param name="text"> eg: Turn all lights on</param>
|
|
///<param name="language"> eg: NL</param>
|
|
///<param name="agentId"> eg: homeassistant</param>
|
|
///<param name="conversationId"> eg: my_conversation_1</param>
|
|
public void Process(string text, string? language = null, object? agentId = null, string? conversationId = null)
|
|
{
|
|
_haContext.CallService("conversation", "process", null, new ConversationProcessParameters { Text = text, Language = language, AgentId = agentId, ConversationId = conversationId });
|
|
}
|
|
|
|
public Task<JsonElement?> ProcessAsync(ConversationProcessParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("conversation", "process", null, data);
|
|
}
|
|
|
|
///<param name="text"> eg: Turn all lights on</param>
|
|
///<param name="language"> eg: NL</param>
|
|
///<param name="agentId"> eg: homeassistant</param>
|
|
///<param name="conversationId"> eg: my_conversation_1</param>
|
|
public Task<JsonElement?> ProcessAsync(string text, string? language = null, object? agentId = null, string? conversationId = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("conversation", "process", null, new ConversationProcessParameters { Text = text, Language = language, AgentId = agentId, ConversationId = conversationId });
|
|
}
|
|
|
|
public void Reload(ConversationReloadParameters data)
|
|
{
|
|
_haContext.CallService("conversation", "reload", null, data);
|
|
}
|
|
|
|
///<param name="language"> eg: NL</param>
|
|
///<param name="agentId"> eg: homeassistant</param>
|
|
public void Reload(string? language = null, object? agentId = null)
|
|
{
|
|
_haContext.CallService("conversation", "reload", null, new ConversationReloadParameters { Language = language, AgentId = agentId });
|
|
}
|
|
}
|
|
|
|
public partial record ConversationProcessParameters
|
|
{
|
|
///<summary> eg: Turn all lights on</summary>
|
|
[JsonPropertyName("text")]
|
|
public string? Text { get; init; }
|
|
|
|
///<summary> eg: NL</summary>
|
|
[JsonPropertyName("language")]
|
|
public string? Language { get; init; }
|
|
|
|
///<summary> eg: homeassistant</summary>
|
|
[JsonPropertyName("agent_id")]
|
|
public object? AgentId { get; init; }
|
|
|
|
///<summary> eg: my_conversation_1</summary>
|
|
[JsonPropertyName("conversation_id")]
|
|
public string? ConversationId { get; init; }
|
|
}
|
|
|
|
public partial record ConversationReloadParameters
|
|
{
|
|
///<summary> eg: NL</summary>
|
|
[JsonPropertyName("language")]
|
|
public string? Language { get; init; }
|
|
|
|
///<summary> eg: homeassistant</summary>
|
|
[JsonPropertyName("agent_id")]
|
|
public object? AgentId { get; init; }
|
|
}
|
|
|
|
public partial class CounterServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public CounterServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Decrement(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("counter", "decrement", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Increment(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("counter", "increment", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Reset(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("counter", "reset", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetValue(ServiceTarget target, CounterSetValueParameters data)
|
|
{
|
|
_haContext.CallService("counter", "set_value", target, data);
|
|
}
|
|
|
|
///<param name="value"></param>
|
|
public void SetValue(ServiceTarget target, long value)
|
|
{
|
|
_haContext.CallService("counter", "set_value", target, new CounterSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public partial record CounterSetValueParameters
|
|
{
|
|
[JsonPropertyName("value")]
|
|
public long? Value { get; init; }
|
|
}
|
|
|
|
public partial class CoverServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public CoverServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void CloseCover(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "close_cover", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void CloseCoverTilt(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "close_cover_tilt", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void OpenCover(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "open_cover", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void OpenCoverTilt(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "open_cover_tilt", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetCoverPosition(ServiceTarget target, CoverSetCoverPositionParameters data)
|
|
{
|
|
_haContext.CallService("cover", "set_cover_position", target, data);
|
|
}
|
|
|
|
///<param name="position"></param>
|
|
public void SetCoverPosition(ServiceTarget target, long position)
|
|
{
|
|
_haContext.CallService("cover", "set_cover_position", target, new CoverSetCoverPositionParameters { Position = position });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetCoverTiltPosition(ServiceTarget target, CoverSetCoverTiltPositionParameters data)
|
|
{
|
|
_haContext.CallService("cover", "set_cover_tilt_position", target, data);
|
|
}
|
|
|
|
///<param name="tiltPosition"></param>
|
|
public void SetCoverTiltPosition(ServiceTarget target, long tiltPosition)
|
|
{
|
|
_haContext.CallService("cover", "set_cover_tilt_position", target, new CoverSetCoverTiltPositionParameters { TiltPosition = tiltPosition });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void StopCover(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "stop_cover", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void StopCoverTilt(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "stop_cover_tilt", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void ToggleCoverTilt(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("cover", "toggle_cover_tilt", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record CoverSetCoverPositionParameters
|
|
{
|
|
[JsonPropertyName("position")]
|
|
public long? Position { get; init; }
|
|
}
|
|
|
|
public partial record CoverSetCoverTiltPositionParameters
|
|
{
|
|
[JsonPropertyName("tilt_position")]
|
|
public long? TiltPosition { get; init; }
|
|
}
|
|
|
|
public partial class DeviceTrackerServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public DeviceTrackerServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void See(DeviceTrackerSeeParameters data)
|
|
{
|
|
_haContext.CallService("device_tracker", "see", null, data);
|
|
}
|
|
|
|
///<param name="mac"> eg: FF:FF:FF:FF:FF:FF</param>
|
|
///<param name="devId"> eg: phonedave</param>
|
|
///<param name="hostName"> eg: Dave</param>
|
|
///<param name="locationName"> eg: home</param>
|
|
///<param name="gps"> eg: [51.509802, -0.086692]</param>
|
|
///<param name="gpsAccuracy"></param>
|
|
///<param name="battery"></param>
|
|
public void See(string? mac = null, string? devId = null, string? hostName = null, string? locationName = null, object? gps = null, long? gpsAccuracy = null, long? battery = null)
|
|
{
|
|
_haContext.CallService("device_tracker", "see", null, new DeviceTrackerSeeParameters { Mac = mac, DevId = devId, HostName = hostName, LocationName = locationName, Gps = gps, GpsAccuracy = gpsAccuracy, Battery = battery });
|
|
}
|
|
}
|
|
|
|
public partial record DeviceTrackerSeeParameters
|
|
{
|
|
///<summary> eg: FF:FF:FF:FF:FF:FF</summary>
|
|
[JsonPropertyName("mac")]
|
|
public string? Mac { get; init; }
|
|
|
|
///<summary> eg: phonedave</summary>
|
|
[JsonPropertyName("dev_id")]
|
|
public string? DevId { get; init; }
|
|
|
|
///<summary> eg: Dave</summary>
|
|
[JsonPropertyName("host_name")]
|
|
public string? HostName { get; init; }
|
|
|
|
///<summary> eg: home</summary>
|
|
[JsonPropertyName("location_name")]
|
|
public string? LocationName { get; init; }
|
|
|
|
///<summary> eg: [51.509802, -0.086692]</summary>
|
|
[JsonPropertyName("gps")]
|
|
public object? Gps { get; init; }
|
|
|
|
[JsonPropertyName("gps_accuracy")]
|
|
public long? GpsAccuracy { get; init; }
|
|
|
|
[JsonPropertyName("battery")]
|
|
public long? Battery { get; init; }
|
|
}
|
|
|
|
public partial class FanServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public FanServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void DecreaseSpeed(ServiceTarget target, FanDecreaseSpeedParameters data)
|
|
{
|
|
_haContext.CallService("fan", "decrease_speed", target, data);
|
|
}
|
|
|
|
///<param name="percentageStep"></param>
|
|
public void DecreaseSpeed(ServiceTarget target, long? percentageStep = null)
|
|
{
|
|
_haContext.CallService("fan", "decrease_speed", target, new FanDecreaseSpeedParameters { PercentageStep = percentageStep });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void IncreaseSpeed(ServiceTarget target, FanIncreaseSpeedParameters data)
|
|
{
|
|
_haContext.CallService("fan", "increase_speed", target, data);
|
|
}
|
|
|
|
///<param name="percentageStep"></param>
|
|
public void IncreaseSpeed(ServiceTarget target, long? percentageStep = null)
|
|
{
|
|
_haContext.CallService("fan", "increase_speed", target, new FanIncreaseSpeedParameters { PercentageStep = percentageStep });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Oscillate(ServiceTarget target, FanOscillateParameters data)
|
|
{
|
|
_haContext.CallService("fan", "oscillate", target, data);
|
|
}
|
|
|
|
///<param name="oscillating"></param>
|
|
public void Oscillate(ServiceTarget target, bool oscillating)
|
|
{
|
|
_haContext.CallService("fan", "oscillate", target, new FanOscillateParameters { Oscillating = oscillating });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetDirection(ServiceTarget target, FanSetDirectionParameters data)
|
|
{
|
|
_haContext.CallService("fan", "set_direction", target, data);
|
|
}
|
|
|
|
///<param name="direction"></param>
|
|
public void SetDirection(ServiceTarget target, object direction)
|
|
{
|
|
_haContext.CallService("fan", "set_direction", target, new FanSetDirectionParameters { Direction = direction });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetPercentage(ServiceTarget target, FanSetPercentageParameters data)
|
|
{
|
|
_haContext.CallService("fan", "set_percentage", target, data);
|
|
}
|
|
|
|
///<param name="percentage"></param>
|
|
public void SetPercentage(ServiceTarget target, long percentage)
|
|
{
|
|
_haContext.CallService("fan", "set_percentage", target, new FanSetPercentageParameters { Percentage = percentage });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetPresetMode(ServiceTarget target, FanSetPresetModeParameters data)
|
|
{
|
|
_haContext.CallService("fan", "set_preset_mode", target, data);
|
|
}
|
|
|
|
///<param name="presetMode"> eg: auto</param>
|
|
public void SetPresetMode(ServiceTarget target, string presetMode)
|
|
{
|
|
_haContext.CallService("fan", "set_preset_mode", target, new FanSetPresetModeParameters { PresetMode = presetMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("fan", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("fan", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, FanTurnOnParameters data)
|
|
{
|
|
_haContext.CallService("fan", "turn_on", target, data);
|
|
}
|
|
|
|
///<param name="percentage"></param>
|
|
///<param name="presetMode"> eg: auto</param>
|
|
public void TurnOn(ServiceTarget target, long? percentage = null, string? presetMode = null)
|
|
{
|
|
_haContext.CallService("fan", "turn_on", target, new FanTurnOnParameters { Percentage = percentage, PresetMode = presetMode });
|
|
}
|
|
}
|
|
|
|
public partial record FanDecreaseSpeedParameters
|
|
{
|
|
[JsonPropertyName("percentage_step")]
|
|
public long? PercentageStep { get; init; }
|
|
}
|
|
|
|
public partial record FanIncreaseSpeedParameters
|
|
{
|
|
[JsonPropertyName("percentage_step")]
|
|
public long? PercentageStep { get; init; }
|
|
}
|
|
|
|
public partial record FanOscillateParameters
|
|
{
|
|
[JsonPropertyName("oscillating")]
|
|
public bool? Oscillating { get; init; }
|
|
}
|
|
|
|
public partial record FanSetDirectionParameters
|
|
{
|
|
[JsonPropertyName("direction")]
|
|
public object? Direction { get; init; }
|
|
}
|
|
|
|
public partial record FanSetPercentageParameters
|
|
{
|
|
[JsonPropertyName("percentage")]
|
|
public long? Percentage { get; init; }
|
|
}
|
|
|
|
public partial record FanSetPresetModeParameters
|
|
{
|
|
///<summary> eg: auto</summary>
|
|
[JsonPropertyName("preset_mode")]
|
|
public string? PresetMode { get; init; }
|
|
}
|
|
|
|
public partial record FanTurnOnParameters
|
|
{
|
|
[JsonPropertyName("percentage")]
|
|
public long? Percentage { get; init; }
|
|
|
|
///<summary> eg: auto</summary>
|
|
[JsonPropertyName("preset_mode")]
|
|
public string? PresetMode { get; init; }
|
|
}
|
|
|
|
public partial class FfmpegServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public FfmpegServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Restart(FfmpegRestartParameters data)
|
|
{
|
|
_haContext.CallService("ffmpeg", "restart", null, data);
|
|
}
|
|
|
|
///<param name="entityId"></param>
|
|
public void Restart(string? entityId = null)
|
|
{
|
|
_haContext.CallService("ffmpeg", "restart", null, new FfmpegRestartParameters { EntityId = entityId });
|
|
}
|
|
|
|
public void Start(FfmpegStartParameters data)
|
|
{
|
|
_haContext.CallService("ffmpeg", "start", null, data);
|
|
}
|
|
|
|
///<param name="entityId"></param>
|
|
public void Start(string? entityId = null)
|
|
{
|
|
_haContext.CallService("ffmpeg", "start", null, new FfmpegStartParameters { EntityId = entityId });
|
|
}
|
|
|
|
public void Stop(FfmpegStopParameters data)
|
|
{
|
|
_haContext.CallService("ffmpeg", "stop", null, data);
|
|
}
|
|
|
|
///<param name="entityId"></param>
|
|
public void Stop(string? entityId = null)
|
|
{
|
|
_haContext.CallService("ffmpeg", "stop", null, new FfmpegStopParameters { EntityId = entityId });
|
|
}
|
|
}
|
|
|
|
public partial record FfmpegRestartParameters
|
|
{
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record FfmpegStartParameters
|
|
{
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record FfmpegStopParameters
|
|
{
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
}
|
|
|
|
public partial class FileServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public FileServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void ReadFile(FileReadFileParameters data)
|
|
{
|
|
_haContext.CallService("file", "read_file", null, data);
|
|
}
|
|
|
|
///<param name="fileName"> eg: www/my_file.json</param>
|
|
///<param name="fileEncoding"> eg: JSON</param>
|
|
public void ReadFile(string? fileName = null, object? fileEncoding = null)
|
|
{
|
|
_haContext.CallService("file", "read_file", null, new FileReadFileParameters { FileName = fileName, FileEncoding = fileEncoding });
|
|
}
|
|
|
|
public Task<JsonElement?> ReadFileAsync(FileReadFileParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("file", "read_file", null, data);
|
|
}
|
|
|
|
///<param name="fileName"> eg: www/my_file.json</param>
|
|
///<param name="fileEncoding"> eg: JSON</param>
|
|
public Task<JsonElement?> ReadFileAsync(string? fileName = null, object? fileEncoding = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("file", "read_file", null, new FileReadFileParameters { FileName = fileName, FileEncoding = fileEncoding });
|
|
}
|
|
}
|
|
|
|
public partial record FileReadFileParameters
|
|
{
|
|
///<summary> eg: www/my_file.json</summary>
|
|
[JsonPropertyName("file_name")]
|
|
public string? FileName { get; init; }
|
|
|
|
///<summary> eg: JSON</summary>
|
|
[JsonPropertyName("file_encoding")]
|
|
public object? FileEncoding { get; init; }
|
|
}
|
|
|
|
public partial class FrontendServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public FrontendServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void ReloadThemes(object? data = null)
|
|
{
|
|
_haContext.CallService("frontend", "reload_themes", null, data);
|
|
}
|
|
|
|
public void SetTheme(FrontendSetThemeParameters data)
|
|
{
|
|
_haContext.CallService("frontend", "set_theme", null, data);
|
|
}
|
|
|
|
///<param name="name"> eg: default</param>
|
|
///<param name="nameDark"> eg: default</param>
|
|
public void SetTheme(object? name = null, object? nameDark = null)
|
|
{
|
|
_haContext.CallService("frontend", "set_theme", null, new FrontendSetThemeParameters { Name = name, NameDark = nameDark });
|
|
}
|
|
}
|
|
|
|
public partial record FrontendSetThemeParameters
|
|
{
|
|
///<summary> eg: default</summary>
|
|
[JsonPropertyName("name")]
|
|
public object? Name { get; init; }
|
|
|
|
///<summary> eg: default</summary>
|
|
[JsonPropertyName("name_dark")]
|
|
public object? NameDark { get; init; }
|
|
}
|
|
|
|
public partial class HassioServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public HassioServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void AddonRestart(HassioAddonRestartParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "addon_restart", null, data);
|
|
}
|
|
|
|
///<param name="addon"> eg: core_ssh</param>
|
|
public void AddonRestart(object addon)
|
|
{
|
|
_haContext.CallService("hassio", "addon_restart", null, new HassioAddonRestartParameters { Addon = addon });
|
|
}
|
|
|
|
public void AddonStart(HassioAddonStartParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "addon_start", null, data);
|
|
}
|
|
|
|
///<param name="addon"> eg: core_ssh</param>
|
|
public void AddonStart(object addon)
|
|
{
|
|
_haContext.CallService("hassio", "addon_start", null, new HassioAddonStartParameters { Addon = addon });
|
|
}
|
|
|
|
public void AddonStdin(HassioAddonStdinParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "addon_stdin", null, data);
|
|
}
|
|
|
|
///<param name="addon"> eg: core_ssh</param>
|
|
public void AddonStdin(object addon)
|
|
{
|
|
_haContext.CallService("hassio", "addon_stdin", null, new HassioAddonStdinParameters { Addon = addon });
|
|
}
|
|
|
|
public void AddonStop(HassioAddonStopParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "addon_stop", null, data);
|
|
}
|
|
|
|
///<param name="addon"> eg: core_ssh</param>
|
|
public void AddonStop(object addon)
|
|
{
|
|
_haContext.CallService("hassio", "addon_stop", null, new HassioAddonStopParameters { Addon = addon });
|
|
}
|
|
|
|
public void AppRestart(HassioAppRestartParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "app_restart", null, data);
|
|
}
|
|
|
|
///<param name="app"> eg: core_ssh</param>
|
|
public void AppRestart(object app)
|
|
{
|
|
_haContext.CallService("hassio", "app_restart", null, new HassioAppRestartParameters { App = app });
|
|
}
|
|
|
|
public void AppStart(HassioAppStartParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "app_start", null, data);
|
|
}
|
|
|
|
///<param name="app"> eg: core_ssh</param>
|
|
public void AppStart(object app)
|
|
{
|
|
_haContext.CallService("hassio", "app_start", null, new HassioAppStartParameters { App = app });
|
|
}
|
|
|
|
public void AppStdin(HassioAppStdinParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "app_stdin", null, data);
|
|
}
|
|
|
|
///<param name="app"> eg: core_ssh</param>
|
|
///<param name="input"></param>
|
|
public void AppStdin(object app, object input)
|
|
{
|
|
_haContext.CallService("hassio", "app_stdin", null, new HassioAppStdinParameters { App = app, Input = input });
|
|
}
|
|
|
|
public void AppStop(HassioAppStopParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "app_stop", null, data);
|
|
}
|
|
|
|
///<param name="app"> eg: core_ssh</param>
|
|
public void AppStop(object app)
|
|
{
|
|
_haContext.CallService("hassio", "app_stop", null, new HassioAppStopParameters { App = app });
|
|
}
|
|
|
|
public void BackupFull(HassioBackupFullParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "backup_full", null, data);
|
|
}
|
|
|
|
///<param name="name"> eg: Backup 1</param>
|
|
///<param name="password"> eg: password</param>
|
|
///<param name="compressed"></param>
|
|
///<param name="location"> eg: my_backup_mount</param>
|
|
///<param name="homeassistantExcludeDatabase"></param>
|
|
public void BackupFull(string? name = null, string? password = null, bool? compressed = null, object? location = null, bool? homeassistantExcludeDatabase = null)
|
|
{
|
|
_haContext.CallService("hassio", "backup_full", null, new HassioBackupFullParameters { Name = name, Password = password, Compressed = compressed, Location = location, HomeassistantExcludeDatabase = homeassistantExcludeDatabase });
|
|
}
|
|
|
|
public void BackupPartial(HassioBackupPartialParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "backup_partial", null, data);
|
|
}
|
|
|
|
///<param name="homeassistant"></param>
|
|
///<param name="homeassistantExcludeDatabase"></param>
|
|
///<param name="apps"> eg: ["core_ssh","core_samba","core_mosquitto"]</param>
|
|
///<param name="addons"> eg: ["core_ssh","core_samba","core_mosquitto"]</param>
|
|
///<param name="folders"> eg: ["homeassistant","share"]</param>
|
|
///<param name="name"> eg: Partial backup 1</param>
|
|
///<param name="password"> eg: password</param>
|
|
///<param name="compressed"></param>
|
|
///<param name="location"> eg: my_backup_mount</param>
|
|
public void BackupPartial(bool? homeassistant = null, bool? homeassistantExcludeDatabase = null, object? apps = null, object? addons = null, object? folders = null, string? name = null, string? password = null, bool? compressed = null, object? location = null)
|
|
{
|
|
_haContext.CallService("hassio", "backup_partial", null, new HassioBackupPartialParameters { Homeassistant = homeassistant, HomeassistantExcludeDatabase = homeassistantExcludeDatabase, Apps = apps, Addons = addons, Folders = folders, Name = name, Password = password, Compressed = compressed, Location = location });
|
|
}
|
|
|
|
public void HostReboot(object? data = null)
|
|
{
|
|
_haContext.CallService("hassio", "host_reboot", null, data);
|
|
}
|
|
|
|
public void HostShutdown(object? data = null)
|
|
{
|
|
_haContext.CallService("hassio", "host_shutdown", null, data);
|
|
}
|
|
|
|
public void RestoreFull(HassioRestoreFullParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "restore_full", null, data);
|
|
}
|
|
|
|
///<param name="slug"></param>
|
|
///<param name="password"> eg: password</param>
|
|
public void RestoreFull(string slug, string? password = null)
|
|
{
|
|
_haContext.CallService("hassio", "restore_full", null, new HassioRestoreFullParameters { Slug = slug, Password = password });
|
|
}
|
|
|
|
public void RestorePartial(HassioRestorePartialParameters data)
|
|
{
|
|
_haContext.CallService("hassio", "restore_partial", null, data);
|
|
}
|
|
|
|
///<param name="slug"></param>
|
|
///<param name="homeassistant"></param>
|
|
///<param name="folders"> eg: ["homeassistant","share"]</param>
|
|
///<param name="apps"> eg: ["core_ssh","core_samba","core_mosquitto"]</param>
|
|
///<param name="addons"> eg: ["core_ssh","core_samba","core_mosquitto"]</param>
|
|
///<param name="password"> eg: password</param>
|
|
public void RestorePartial(string slug, bool? homeassistant = null, object? folders = null, object? apps = null, object? addons = null, string? password = null)
|
|
{
|
|
_haContext.CallService("hassio", "restore_partial", null, new HassioRestorePartialParameters { Slug = slug, Homeassistant = homeassistant, Folders = folders, Apps = apps, Addons = addons, Password = password });
|
|
}
|
|
}
|
|
|
|
public partial record HassioAddonRestartParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("addon")]
|
|
public object? Addon { get; init; }
|
|
}
|
|
|
|
public partial record HassioAddonStartParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("addon")]
|
|
public object? Addon { get; init; }
|
|
}
|
|
|
|
public partial record HassioAddonStdinParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("addon")]
|
|
public object? Addon { get; init; }
|
|
}
|
|
|
|
public partial record HassioAddonStopParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("addon")]
|
|
public object? Addon { get; init; }
|
|
}
|
|
|
|
public partial record HassioAppRestartParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("app")]
|
|
public object? App { get; init; }
|
|
}
|
|
|
|
public partial record HassioAppStartParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("app")]
|
|
public object? App { get; init; }
|
|
}
|
|
|
|
public partial record HassioAppStdinParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("app")]
|
|
public object? App { get; init; }
|
|
|
|
[JsonPropertyName("input")]
|
|
public object? Input { get; init; }
|
|
}
|
|
|
|
public partial record HassioAppStopParameters
|
|
{
|
|
///<summary> eg: core_ssh</summary>
|
|
[JsonPropertyName("app")]
|
|
public object? App { get; init; }
|
|
}
|
|
|
|
public partial record HassioBackupFullParameters
|
|
{
|
|
///<summary> eg: Backup 1</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary> eg: password</summary>
|
|
[JsonPropertyName("password")]
|
|
public string? Password { get; init; }
|
|
|
|
[JsonPropertyName("compressed")]
|
|
public bool? Compressed { get; init; }
|
|
|
|
///<summary> eg: my_backup_mount</summary>
|
|
[JsonPropertyName("location")]
|
|
public object? Location { get; init; }
|
|
|
|
[JsonPropertyName("homeassistant_exclude_database")]
|
|
public bool? HomeassistantExcludeDatabase { get; init; }
|
|
}
|
|
|
|
public partial record HassioBackupPartialParameters
|
|
{
|
|
[JsonPropertyName("homeassistant")]
|
|
public bool? Homeassistant { get; init; }
|
|
|
|
[JsonPropertyName("homeassistant_exclude_database")]
|
|
public bool? HomeassistantExcludeDatabase { get; init; }
|
|
|
|
///<summary> eg: ["core_ssh","core_samba","core_mosquitto"]</summary>
|
|
[JsonPropertyName("apps")]
|
|
public object? Apps { get; init; }
|
|
|
|
///<summary> eg: ["core_ssh","core_samba","core_mosquitto"]</summary>
|
|
[JsonPropertyName("addons")]
|
|
public object? Addons { get; init; }
|
|
|
|
///<summary> eg: ["homeassistant","share"]</summary>
|
|
[JsonPropertyName("folders")]
|
|
public object? Folders { get; init; }
|
|
|
|
///<summary> eg: Partial backup 1</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary> eg: password</summary>
|
|
[JsonPropertyName("password")]
|
|
public string? Password { get; init; }
|
|
|
|
[JsonPropertyName("compressed")]
|
|
public bool? Compressed { get; init; }
|
|
|
|
///<summary> eg: my_backup_mount</summary>
|
|
[JsonPropertyName("location")]
|
|
public object? Location { get; init; }
|
|
}
|
|
|
|
public partial record HassioRestoreFullParameters
|
|
{
|
|
[JsonPropertyName("slug")]
|
|
public string? Slug { get; init; }
|
|
|
|
///<summary> eg: password</summary>
|
|
[JsonPropertyName("password")]
|
|
public string? Password { get; init; }
|
|
}
|
|
|
|
public partial record HassioRestorePartialParameters
|
|
{
|
|
[JsonPropertyName("slug")]
|
|
public string? Slug { get; init; }
|
|
|
|
[JsonPropertyName("homeassistant")]
|
|
public bool? Homeassistant { get; init; }
|
|
|
|
///<summary> eg: ["homeassistant","share"]</summary>
|
|
[JsonPropertyName("folders")]
|
|
public object? Folders { get; init; }
|
|
|
|
///<summary> eg: ["core_ssh","core_samba","core_mosquitto"]</summary>
|
|
[JsonPropertyName("apps")]
|
|
public object? Apps { get; init; }
|
|
|
|
///<summary> eg: ["core_ssh","core_samba","core_mosquitto"]</summary>
|
|
[JsonPropertyName("addons")]
|
|
public object? Addons { get; init; }
|
|
|
|
///<summary> eg: password</summary>
|
|
[JsonPropertyName("password")]
|
|
public string? Password { get; init; }
|
|
}
|
|
|
|
public partial class HomeassistantServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public HomeassistantServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Adds an alias to an area.</summary>
|
|
public void AddAliasToArea(HomeassistantAddAliasToAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_alias_to_area", null, data);
|
|
}
|
|
|
|
///<summary>Adds an alias to an area.</summary>
|
|
///<param name="areaId">The ID of the area to add the alias to.</param>
|
|
///<param name="alias">The alias (or list of aliasses) to add to the area.</param>
|
|
public void AddAliasToArea(string areaId, object @alias)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_alias_to_area", null, new HomeassistantAddAliasToAreaParameters { AreaId = areaId, Alias = @alias });
|
|
}
|
|
|
|
///<summary>Adds an alias to a floor.</summary>
|
|
public void AddAliasToFloor(HomeassistantAddAliasToFloorParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_alias_to_floor", null, data);
|
|
}
|
|
|
|
///<summary>Adds an alias to a floor.</summary>
|
|
///<param name="floorId">The ID of the floor to add the alias to.</param>
|
|
///<param name="alias">The alias (or list of aliasses) to add to the floor.</param>
|
|
public void AddAliasToFloor(object floorId, object @alias)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_alias_to_floor", null, new HomeassistantAddAliasToFloorParameters { FloorId = floorId, Alias = @alias });
|
|
}
|
|
|
|
///<summary>Adds an area to a floor. Please note, if the area is already on a floor, it will be removed from the previous floor.</summary>
|
|
public void AddAreaToFloor(HomeassistantAddAreaToFloorParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_area_to_floor", null, data);
|
|
}
|
|
|
|
///<summary>Adds an area to a floor. Please note, if the area is already on a floor, it will be removed from the previous floor.</summary>
|
|
///<param name="floorId">The ID of the floor to add the area on.</param>
|
|
///<param name="areaId">The ID of the area(s) to add to the floor.</param>
|
|
public void AddAreaToFloor(object floorId, IEnumerable<string> areaId)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_area_to_floor", null, new HomeassistantAddAreaToFloorParameters { FloorId = floorId, AreaId = areaId });
|
|
}
|
|
|
|
///<summary>Adds an device to an area. Please note, if the device is already in an area, it will be removed from the previous area.</summary>
|
|
public void AddDeviceToArea(HomeassistantAddDeviceToAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_device_to_area", null, data);
|
|
}
|
|
|
|
///<summary>Adds an device to an area. Please note, if the device is already in an area, it will be removed from the previous area.</summary>
|
|
///<param name="areaId">The ID of the area to add the device to.</param>
|
|
///<param name="deviceId">The ID of the device(s) to add to the area.</param>
|
|
public void AddDeviceToArea(string areaId, IEnumerable<string> deviceId)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_device_to_area", null, new HomeassistantAddDeviceToAreaParameters { AreaId = areaId, DeviceId = deviceId });
|
|
}
|
|
|
|
///<summary>Adds an entity to an area. Please note, if the enity is already in an area, it will be removed from the previous area. This will override the area the device, that provides this entity, is in.</summary>
|
|
public void AddEntityToArea(HomeassistantAddEntityToAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_entity_to_area", null, data);
|
|
}
|
|
|
|
///<summary>Adds an entity to an area. Please note, if the enity is already in an area, it will be removed from the previous area. This will override the area the device, that provides this entity, is in.</summary>
|
|
///<param name="areaId">The ID of the area to add the entity to.</param>
|
|
///<param name="entityId">The ID of the entity (or entities) to add to the area.</param>
|
|
public void AddEntityToArea(string areaId, IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_entity_to_area", null, new HomeassistantAddEntityToAreaParameters { AreaId = areaId, EntityId = entityId });
|
|
}
|
|
|
|
///<summary>Adds a label to an area. If multiple labels or multiple areas are provided, all combinations will be added.</summary>
|
|
public void AddLabelToArea(HomeassistantAddLabelToAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_label_to_area", null, data);
|
|
}
|
|
|
|
///<summary>Adds a label to an area. If multiple labels or multiple areas are provided, all combinations will be added.</summary>
|
|
///<param name="labelId">The ID(s) of the label(s) to add the area(s).</param>
|
|
///<param name="areaId">The ID(s) of the area(s) to add the label(s) to.</param>
|
|
public void AddLabelToArea(IEnumerable<object> labelId, IEnumerable<string> areaId)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_label_to_area", null, new HomeassistantAddLabelToAreaParameters { LabelId = labelId, AreaId = areaId });
|
|
}
|
|
|
|
///<summary>Adds a label to a device. If multiple labels or multiple devices are provided, all combinations will be added.</summary>
|
|
public void AddLabelToDevice(HomeassistantAddLabelToDeviceParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_label_to_device", null, data);
|
|
}
|
|
|
|
///<summary>Adds a label to a device. If multiple labels or multiple devices are provided, all combinations will be added.</summary>
|
|
///<param name="labelId">The ID(s) of the label(s) to add the device(s).</param>
|
|
///<param name="deviceId">The ID(s) of the device(s) to add the label(s) to.</param>
|
|
public void AddLabelToDevice(IEnumerable<object> labelId, IEnumerable<string> deviceId)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_label_to_device", null, new HomeassistantAddLabelToDeviceParameters { LabelId = labelId, DeviceId = deviceId });
|
|
}
|
|
|
|
///<summary>Adds a label to an entity. If multiple labels or multiple entities are provided, all combinations will be added.</summary>
|
|
public void AddLabelToEntity(HomeassistantAddLabelToEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_label_to_entity", null, data);
|
|
}
|
|
|
|
///<summary>Adds a label to an entity. If multiple labels or multiple entities are provided, all combinations will be added.</summary>
|
|
///<param name="labelId">The ID(s) of the label(s) to add the entity/entities.</param>
|
|
///<param name="entityId">The ID(s) of the entity/entities to add the label(s) to.</param>
|
|
public void AddLabelToEntity(IEnumerable<object> labelId, IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "add_label_to_entity", null, new HomeassistantAddLabelToEntityParameters { LabelId = labelId, EntityId = entityId });
|
|
}
|
|
|
|
public void CheckConfig(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "check_config", null, data);
|
|
}
|
|
|
|
///<summary>Creates a new area on the fly.</summary>
|
|
public void CreateArea(HomeassistantCreateAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "create_area", null, data);
|
|
}
|
|
|
|
///<summary>Creates a new area on the fly.</summary>
|
|
///<param name="name">The name of the area to create.</param>
|
|
///<param name="icon">Icon to use for the area.</param>
|
|
///<param name="aliases">A list of aliases for the area. This is useful if you want to use the area in a different language or different nickname.</param>
|
|
public void CreateArea(string name, object? icon = null, object? aliases = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "create_area", null, new HomeassistantCreateAreaParameters { Name = name, Icon = icon, Aliases = aliases });
|
|
}
|
|
|
|
///<summary>Creates a new floor on the fly.</summary>
|
|
public void CreateFloor(HomeassistantCreateFloorParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "create_floor", null, data);
|
|
}
|
|
|
|
///<summary>Creates a new floor on the fly.</summary>
|
|
///<param name="name">The name of the floor to create.</param>
|
|
///<param name="icon">Icon to use for the floor.</param>
|
|
///<param name="level">The level the floor is on in your home.</param>
|
|
///<param name="aliases">A list of aliases for the floor. This is useful if you want to use the floor in a different language or different nickname.</param>
|
|
public void CreateFloor(string name, object? icon = null, long? level = null, object? aliases = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "create_floor", null, new HomeassistantCreateFloorParameters { Name = name, Icon = icon, Level = level, Aliases = aliases });
|
|
}
|
|
|
|
///<summary>Creates a new label on the fly.</summary>
|
|
public void CreateLabel(HomeassistantCreateLabelParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "create_label", null, data);
|
|
}
|
|
|
|
///<summary>Creates a new label on the fly.</summary>
|
|
///<param name="name">The name of the label to create.</param>
|
|
///<param name="description">Description for the label.</param>
|
|
///<param name="icon">Icon to use for the label.</param>
|
|
///<param name="color">Color to use for the label. Can be a color name from the list, or a hex color code (like #FF0000).</param>
|
|
public void CreateLabel(string name, string description, object? icon = null, object? color = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "create_label", null, new HomeassistantCreateLabelParameters { Name = name, Description = description, Icon = icon, Color = color });
|
|
}
|
|
|
|
///<summary>Deletes all orphaned entities that no longer have an integration that claim/provide them. Please note, if the integration was just removed, it might need a restart for Home Assistant to realize they are orphaned. **WARNING** Entities might have been marked orphaned because an integration is offline or not working since Home Assistant started. Calling this action will delete those entities as well.</summary>
|
|
public void DeleteAllOrphanedEntities(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "delete_all_orphaned_entities", null, data);
|
|
}
|
|
|
|
///<summary>Deletes a new area on the fly.</summary>
|
|
public void DeleteArea(HomeassistantDeleteAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "delete_area", null, data);
|
|
}
|
|
|
|
///<summary>Deletes a new area on the fly.</summary>
|
|
///<param name="areaId">The ID of the area to delete.</param>
|
|
public void DeleteArea(string areaId)
|
|
{
|
|
_haContext.CallService("homeassistant", "delete_area", null, new HomeassistantDeleteAreaParameters { AreaId = areaId });
|
|
}
|
|
|
|
///<summary>Deletes a floor on the fly.</summary>
|
|
public void DeleteFloor(HomeassistantDeleteFloorParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "delete_floor", null, data);
|
|
}
|
|
|
|
///<summary>Deletes a floor on the fly.</summary>
|
|
///<param name="floorId">The ID of the floor to delete.</param>
|
|
public void DeleteFloor(object floorId)
|
|
{
|
|
_haContext.CallService("homeassistant", "delete_floor", null, new HomeassistantDeleteFloorParameters { FloorId = floorId });
|
|
}
|
|
|
|
///<summary>Deletes a label on the fly.</summary>
|
|
public void DeleteLabel(HomeassistantDeleteLabelParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "delete_label", null, data);
|
|
}
|
|
|
|
///<summary>Deletes a label on the fly.</summary>
|
|
///<param name="labelId">The ID of the label to delete.</param>
|
|
public void DeleteLabel(object labelId)
|
|
{
|
|
_haContext.CallService("homeassistant", "delete_label", null, new HomeassistantDeleteLabelParameters { LabelId = labelId });
|
|
}
|
|
|
|
///<summary>Disables an integration configuration entry.</summary>
|
|
public void DisableConfigEntry(HomeassistantDisableConfigEntryParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_config_entry", null, data);
|
|
}
|
|
|
|
///<summary>Disables an integration configuration entry.</summary>
|
|
///<param name="configEntryId">The integration configuration entry to disable.</param>
|
|
public void DisableConfigEntry(object configEntryId)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_config_entry", null, new HomeassistantDisableConfigEntryParameters { ConfigEntryId = configEntryId });
|
|
}
|
|
|
|
///<summary>Disables a device on the fly.</summary>
|
|
public void DisableDevice(HomeassistantDisableDeviceParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_device", null, data);
|
|
}
|
|
|
|
///<summary>Disables a device on the fly.</summary>
|
|
///<param name="deviceId">The device(s) to disable.</param>
|
|
public void DisableDevice(IEnumerable<string> deviceId)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_device", null, new HomeassistantDisableDeviceParameters { DeviceId = deviceId });
|
|
}
|
|
|
|
///<summary>Disables an entity (or entities) on the fly.</summary>
|
|
public void DisableEntity(HomeassistantDisableEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_entity", null, data);
|
|
}
|
|
|
|
///<summary>Disables an entity (or entities) on the fly.</summary>
|
|
///<param name="entityId">The entity/entities to disable.</param>
|
|
public void DisableEntity(IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_entity", null, new HomeassistantDisableEntityParameters { EntityId = entityId });
|
|
}
|
|
|
|
///<summary>Disables polling for updates for an integration configuration entry.</summary>
|
|
public void DisablePolling(HomeassistantDisablePollingParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_polling", null, data);
|
|
}
|
|
|
|
///<summary>Disables polling for updates for an integration configuration entry.</summary>
|
|
///<param name="configEntryId">The integration configuration entry to disable polling for.</param>
|
|
public void DisablePolling(object configEntryId)
|
|
{
|
|
_haContext.CallService("homeassistant", "disable_polling", null, new HomeassistantDisablePollingParameters { ConfigEntryId = configEntryId });
|
|
}
|
|
|
|
///<summary>Enables an integration configuration entry.</summary>
|
|
public void EnableConfigEntry(HomeassistantEnableConfigEntryParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_config_entry", null, data);
|
|
}
|
|
|
|
///<summary>Enables an integration configuration entry.</summary>
|
|
///<param name="configEntryId">The integration configuration entry to enable.</param>
|
|
public void EnableConfigEntry(object configEntryId)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_config_entry", null, new HomeassistantEnableConfigEntryParameters { ConfigEntryId = configEntryId });
|
|
}
|
|
|
|
///<summary>Enables a device on the fly.</summary>
|
|
public void EnableDevice(HomeassistantEnableDeviceParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_device", null, data);
|
|
}
|
|
|
|
///<summary>Enables a device on the fly.</summary>
|
|
///<param name="deviceId">The device(s) to enable.</param>
|
|
public void EnableDevice(IEnumerable<string> deviceId)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_device", null, new HomeassistantEnableDeviceParameters { DeviceId = deviceId });
|
|
}
|
|
|
|
///<summary>Enables an entity (or entities) on the fly.</summary>
|
|
public void EnableEntity(HomeassistantEnableEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_entity", null, data);
|
|
}
|
|
|
|
///<summary>Enables an entity (or entities) on the fly.</summary>
|
|
///<param name="entityId">The entity/entities to enable.</param>
|
|
public void EnableEntity(IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_entity", null, new HomeassistantEnableEntityParameters { EntityId = entityId });
|
|
}
|
|
|
|
///<summary>Enables polling for updates for an integration configuration entry.</summary>
|
|
public void EnablePolling(HomeassistantEnablePollingParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_polling", null, data);
|
|
}
|
|
|
|
///<summary>Enables polling for updates for an integration configuration entry.</summary>
|
|
///<param name="configEntryId">The integration configuration entry to enable polling for.</param>
|
|
public void EnablePolling(object configEntryId)
|
|
{
|
|
_haContext.CallService("homeassistant", "enable_polling", null, new HomeassistantEnablePollingParameters { ConfigEntryId = configEntryId });
|
|
}
|
|
|
|
///<summary>Hides an entity (or entities) on the fly.</summary>
|
|
public void HideEntity(HomeassistantHideEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "hide_entity", null, data);
|
|
}
|
|
|
|
///<summary>Hides an entity (or entities) on the fly.</summary>
|
|
///<param name="entityId">The entity/entities to hide.</param>
|
|
public void HideEntity(IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "hide_entity", null, new HomeassistantHideEntityParameters { EntityId = entityId });
|
|
}
|
|
|
|
///<summary>Ignore all currently discovered devices that are shown on the integrations dashboard. This will not ignore devices that are discovered after this.</summary>
|
|
public void IgnoreAllDiscovered(HomeassistantIgnoreAllDiscoveredParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "ignore_all_discovered", null, data);
|
|
}
|
|
|
|
///<summary>Ignore all currently discovered devices that are shown on the integrations dashboard. This will not ignore devices that are discovered after this.</summary>
|
|
///<param name="domain">The integration domain to ignore all discovered devices for. If not provided, all domains will be considered to be ignored.</param>
|
|
public void IgnoreAllDiscovered(string? domain = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "ignore_all_discovered", null, new HomeassistantIgnoreAllDiscoveredParameters { Domain = domain });
|
|
}
|
|
|
|
///<summary>Lists all orphaned database entities unclaimed by any integration.</summary>
|
|
public void ListOrphanedDatabaseEntities(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "list_orphaned_database_entities", null, data);
|
|
}
|
|
|
|
///<summary>Lists all orphaned database entities unclaimed by any integration.</summary>
|
|
public Task<JsonElement?> ListOrphanedDatabaseEntitiesAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("homeassistant", "list_orphaned_database_entities", null, data);
|
|
}
|
|
|
|
public void ReloadAll(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "reload_all", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void ReloadConfigEntry(ServiceTarget target, HomeassistantReloadConfigEntryParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "reload_config_entry", target, data);
|
|
}
|
|
|
|
///<param name="entryId"> eg: 8955375327824e14ba89e4b29cc3ec9a</param>
|
|
public void ReloadConfigEntry(ServiceTarget target, object? entryId = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "reload_config_entry", target, new HomeassistantReloadConfigEntryParameters { EntryId = entryId });
|
|
}
|
|
|
|
public void ReloadCoreConfig(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "reload_core_config", null, data);
|
|
}
|
|
|
|
public void ReloadCustomTemplates(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "reload_custom_templates", null, data);
|
|
}
|
|
|
|
///<summary>Removes an alias from an area.</summary>
|
|
public void RemoveAliasFromArea(HomeassistantRemoveAliasFromAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_alias_from_area", null, data);
|
|
}
|
|
|
|
///<summary>Removes an alias from an area.</summary>
|
|
///<param name="areaId">The ID of the area to remove the alias from.</param>
|
|
///<param name="alias">The alias (or list of aliasses) to remove from the area.</param>
|
|
public void RemoveAliasFromArea(string areaId, object @alias)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_alias_from_area", null, new HomeassistantRemoveAliasFromAreaParameters { AreaId = areaId, Alias = @alias });
|
|
}
|
|
|
|
///<summary>Removes an alias from a floor.</summary>
|
|
public void RemoveAliasFromFloor(HomeassistantRemoveAliasFromFloorParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_alias_from_floor", null, data);
|
|
}
|
|
|
|
///<summary>Removes an alias from a floor.</summary>
|
|
///<param name="floorId">The ID of the floor to remove the alias from.</param>
|
|
///<param name="alias">The alias (or list of aliasses) to remove from the floor.</param>
|
|
public void RemoveAliasFromFloor(object floorId, object @alias)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_alias_from_floor", null, new HomeassistantRemoveAliasFromFloorParameters { FloorId = floorId, Alias = @alias });
|
|
}
|
|
|
|
///<summary>Removes an area from a floor. As an area can only be on one floor, this call doesn't need to specify the floor.</summary>
|
|
public void RemoveAreaFromFloor(HomeassistantRemoveAreaFromFloorParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_area_from_floor", null, data);
|
|
}
|
|
|
|
///<summary>Removes an area from a floor. As an area can only be on one floor, this call doesn't need to specify the floor.</summary>
|
|
///<param name="areaId">The ID of the area to remove the floor from.</param>
|
|
public void RemoveAreaFromFloor(IEnumerable<string> areaId)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_area_from_floor", null, new HomeassistantRemoveAreaFromFloorParameters { AreaId = areaId });
|
|
}
|
|
|
|
///<summary>Removes a device from an area. As a device can only be in one area, this call doesn't need to specify the area.</summary>
|
|
public void RemoveDeviceFromArea(HomeassistantRemoveDeviceFromAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_device_from_area", null, data);
|
|
}
|
|
|
|
///<summary>Removes a device from an area. As a device can only be in one area, this call doesn't need to specify the area.</summary>
|
|
///<param name="deviceId">The ID of the device to remove the area from.</param>
|
|
public void RemoveDeviceFromArea(IEnumerable<string> deviceId)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_device_from_area", null, new HomeassistantRemoveDeviceFromAreaParameters { DeviceId = deviceId });
|
|
}
|
|
|
|
///<summary>Removes an entity from an area. As an entity can only be in one area, this call doesn't need to specify the area. Please note, the entity will still be in the area of the device that provides it after this call.</summary>
|
|
public void RemoveEntityFromArea(HomeassistantRemoveEntityFromAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_entity_from_area", null, data);
|
|
}
|
|
|
|
///<summary>Removes an entity from an area. As an entity can only be in one area, this call doesn't need to specify the area. Please note, the entity will still be in the area of the device that provides it after this call.</summary>
|
|
///<param name="entityId">The ID of the entity (or entities) to remove the area from.</param>
|
|
public void RemoveEntityFromArea(IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_entity_from_area", null, new HomeassistantRemoveEntityFromAreaParameters { EntityId = entityId });
|
|
}
|
|
|
|
///<summary>Removes a label to an area. If multiple labels or multiple areas are provided, all combinations will be removed.</summary>
|
|
public void RemoveLabelFromArea(HomeassistantRemoveLabelFromAreaParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_label_from_area", null, data);
|
|
}
|
|
|
|
///<summary>Removes a label to an area. If multiple labels or multiple areas are provided, all combinations will be removed.</summary>
|
|
///<param name="labelId">The ID(s) of the label(s) to remove from the area(s).</param>
|
|
///<param name="areaId">The ID(s) of the area(s) to remove the label(s) from.</param>
|
|
public void RemoveLabelFromArea(IEnumerable<object> labelId, IEnumerable<string> areaId)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_label_from_area", null, new HomeassistantRemoveLabelFromAreaParameters { LabelId = labelId, AreaId = areaId });
|
|
}
|
|
|
|
///<summary>Removes a label from a device. If multiple labels or multiple devices are provided, all combinations will be removed.</summary>
|
|
public void RemoveLabelFromDevice(HomeassistantRemoveLabelFromDeviceParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_label_from_device", null, data);
|
|
}
|
|
|
|
///<summary>Removes a label from a device. If multiple labels or multiple devices are provided, all combinations will be removed.</summary>
|
|
///<param name="labelId">The ID(s) of the label(s) to remove from the device(s).</param>
|
|
///<param name="deviceId">The ID(s) of the device(s) to remove the label(s) from.</param>
|
|
public void RemoveLabelFromDevice(IEnumerable<object> labelId, IEnumerable<string> deviceId)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_label_from_device", null, new HomeassistantRemoveLabelFromDeviceParameters { LabelId = labelId, DeviceId = deviceId });
|
|
}
|
|
|
|
///<summary>Removes a label from an entity. If multiple labels or multiple entities are provided, all combinations will be removed.</summary>
|
|
public void RemoveLabelFromEntity(HomeassistantRemoveLabelFromEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_label_from_entity", null, data);
|
|
}
|
|
|
|
///<summary>Removes a label from an entity. If multiple labels or multiple entities are provided, all combinations will be removed.</summary>
|
|
///<param name="labelId">The ID(s) of the label(s) to remove from the entity/entities.</param>
|
|
///<param name="entityId">The ID(s) of the entity/entities to remove the label(s) from.</param>
|
|
public void RemoveLabelFromEntity(IEnumerable<object> labelId, IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "remove_label_from_entity", null, new HomeassistantRemoveLabelFromEntityParameters { LabelId = labelId, EntityId = entityId });
|
|
}
|
|
|
|
///<summary>Renames an entity (or entities) on the fly.</summary>
|
|
public void RenameEntity(HomeassistantRenameEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "rename_entity", null, data);
|
|
}
|
|
|
|
///<summary>Renames an entity (or entities) on the fly.</summary>
|
|
///<param name="entityId">The entity/entities to rename.</param>
|
|
///<param name="name">The new name for the entity/entities.</param>
|
|
public void RenameEntity(IEnumerable<string> entityId, string name)
|
|
{
|
|
_haContext.CallService("homeassistant", "rename_entity", null, new HomeassistantRenameEntityParameters { EntityId = entityId, Name = name });
|
|
}
|
|
|
|
///<summary>Restart the Home Assistant action.</summary>
|
|
public void Restart(HomeassistantRestartParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "restart", null, data);
|
|
}
|
|
|
|
///<summary>Restart the Home Assistant action.</summary>
|
|
///<param name="safeMode">If the restart should be done in safe mode. This will disable all custom integrations and frontend modules.</param>
|
|
///<param name="force">Force the restart. WARNING! This will not gracefully shutdown Home Assistant, it will skip configuration checks and ignore running database migrations. Only use this if you know what you are doing.</param>
|
|
public void Restart(bool? safeMode = null, bool? force = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "restart", null, new HomeassistantRestartParameters { SafeMode = safeMode, Force = force });
|
|
}
|
|
|
|
public void SavePersistentStates(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "save_persistent_states", null, data);
|
|
}
|
|
|
|
///<summary>Sets aliases for an area. Overwrite and removed any existing aliases, fully replacing them with the new ones.</summary>
|
|
public void SetAreaAliases(HomeassistantSetAreaAliasesParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "set_area_aliases", null, data);
|
|
}
|
|
|
|
///<summary>Sets aliases for an area. Overwrite and removed any existing aliases, fully replacing them with the new ones.</summary>
|
|
///<param name="areaId">The ID of the area to set the aliases for.</param>
|
|
///<param name="aliases">The aliases to set for the area.</param>
|
|
public void SetAreaAliases(string areaId, object aliases)
|
|
{
|
|
_haContext.CallService("homeassistant", "set_area_aliases", null, new HomeassistantSetAreaAliasesParameters { AreaId = areaId, Aliases = aliases });
|
|
}
|
|
|
|
///<summary>Sets aliases for a floor. Overwrite and removed any existing aliases, fully replacing them with the new ones.</summary>
|
|
public void SetFloorAliases(HomeassistantSetFloorAliasesParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "set_floor_aliases", null, data);
|
|
}
|
|
|
|
///<summary>Sets aliases for a floor. Overwrite and removed any existing aliases, fully replacing them with the new ones.</summary>
|
|
///<param name="floorId">The ID of the floor to set the aliases for.</param>
|
|
///<param name="aliases">The aliases to set for the floor.</param>
|
|
public void SetFloorAliases(object floorId, object aliases)
|
|
{
|
|
_haContext.CallService("homeassistant", "set_floor_aliases", null, new HomeassistantSetFloorAliasesParameters { FloorId = floorId, Aliases = aliases });
|
|
}
|
|
|
|
public void SetLocation(HomeassistantSetLocationParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "set_location", null, data);
|
|
}
|
|
|
|
///<param name="latitude"> eg: 32.87336</param>
|
|
///<param name="longitude"> eg: 117.22743</param>
|
|
///<param name="elevation"> eg: 120</param>
|
|
public void SetLocation(double latitude, double longitude, double? elevation = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "set_location", null, new HomeassistantSetLocationParameters { Latitude = latitude, Longitude = longitude, Elevation = elevation });
|
|
}
|
|
|
|
public void Stop(object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "stop", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("homeassistant", "turn_on", target, data);
|
|
}
|
|
|
|
///<summary>Unhides an entity (or entities) on the fly.</summary>
|
|
public void UnhideEntity(HomeassistantUnhideEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "unhide_entity", null, data);
|
|
}
|
|
|
|
///<summary>Unhides an entity (or entities) on the fly.</summary>
|
|
///<param name="entityId">The entity/entities to unhide.</param>
|
|
public void UnhideEntity(IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "unhide_entity", null, new HomeassistantUnhideEntityParameters { EntityId = entityId });
|
|
}
|
|
|
|
public void UpdateEntity(HomeassistantUpdateEntityParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "update_entity", null, data);
|
|
}
|
|
|
|
///<param name="entityId"></param>
|
|
public void UpdateEntity(IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "update_entity", null, new HomeassistantUpdateEntityParameters { EntityId = entityId });
|
|
}
|
|
|
|
///<summary>Updates an entity's ID on the fly.</summary>
|
|
public void UpdateEntityId(HomeassistantUpdateEntityIdParameters data)
|
|
{
|
|
_haContext.CallService("homeassistant", "update_entity_id", null, data);
|
|
}
|
|
|
|
///<summary>Updates an entity's ID on the fly.</summary>
|
|
///<param name="entityId">The entity/entities to update.</param>
|
|
///<param name="newEntityId">The new ID for the entity</param>
|
|
public void UpdateEntityId(string entityId, string newEntityId)
|
|
{
|
|
_haContext.CallService("homeassistant", "update_entity_id", null, new HomeassistantUpdateEntityIdParameters { EntityId = entityId, NewEntityId = newEntityId });
|
|
}
|
|
}
|
|
|
|
public partial record HomeassistantAddAliasToAreaParameters
|
|
{
|
|
///<summary>The ID of the area to add the alias to.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public string? AreaId { get; init; }
|
|
|
|
///<summary>The alias (or list of aliasses) to add to the area.</summary>
|
|
[JsonPropertyName("alias")]
|
|
public object? Alias { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantAddAliasToFloorParameters
|
|
{
|
|
///<summary>The ID of the floor to add the alias to.</summary>
|
|
[JsonPropertyName("floor_id")]
|
|
public object? FloorId { get; init; }
|
|
|
|
///<summary>The alias (or list of aliasses) to add to the floor.</summary>
|
|
[JsonPropertyName("alias")]
|
|
public object? Alias { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantAddAreaToFloorParameters
|
|
{
|
|
///<summary>The ID of the floor to add the area on.</summary>
|
|
[JsonPropertyName("floor_id")]
|
|
public object? FloorId { get; init; }
|
|
|
|
///<summary>The ID of the area(s) to add to the floor.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public IEnumerable<string>? AreaId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantAddDeviceToAreaParameters
|
|
{
|
|
///<summary>The ID of the area to add the device to.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public string? AreaId { get; init; }
|
|
|
|
///<summary>The ID of the device(s) to add to the area.</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public IEnumerable<string>? DeviceId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantAddEntityToAreaParameters
|
|
{
|
|
///<summary>The ID of the area to add the entity to.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public string? AreaId { get; init; }
|
|
|
|
///<summary>The ID of the entity (or entities) to add to the area.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantAddLabelToAreaParameters
|
|
{
|
|
///<summary>The ID(s) of the label(s) to add the area(s).</summary>
|
|
[JsonPropertyName("label_id")]
|
|
public IEnumerable<object>? LabelId { get; init; }
|
|
|
|
///<summary>The ID(s) of the area(s) to add the label(s) to.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public IEnumerable<string>? AreaId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantAddLabelToDeviceParameters
|
|
{
|
|
///<summary>The ID(s) of the label(s) to add the device(s).</summary>
|
|
[JsonPropertyName("label_id")]
|
|
public IEnumerable<object>? LabelId { get; init; }
|
|
|
|
///<summary>The ID(s) of the device(s) to add the label(s) to.</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public IEnumerable<string>? DeviceId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantAddLabelToEntityParameters
|
|
{
|
|
///<summary>The ID(s) of the label(s) to add the entity/entities.</summary>
|
|
[JsonPropertyName("label_id")]
|
|
public IEnumerable<object>? LabelId { get; init; }
|
|
|
|
///<summary>The ID(s) of the entity/entities to add the label(s) to.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantCreateAreaParameters
|
|
{
|
|
///<summary>The name of the area to create.</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary>Icon to use for the area.</summary>
|
|
[JsonPropertyName("icon")]
|
|
public object? Icon { get; init; }
|
|
|
|
///<summary>A list of aliases for the area. This is useful if you want to use the area in a different language or different nickname.</summary>
|
|
[JsonPropertyName("aliases")]
|
|
public object? Aliases { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantCreateFloorParameters
|
|
{
|
|
///<summary>The name of the floor to create.</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary>Icon to use for the floor.</summary>
|
|
[JsonPropertyName("icon")]
|
|
public object? Icon { get; init; }
|
|
|
|
///<summary>The level the floor is on in your home.</summary>
|
|
[JsonPropertyName("level")]
|
|
public long? Level { get; init; }
|
|
|
|
///<summary>A list of aliases for the floor. This is useful if you want to use the floor in a different language or different nickname.</summary>
|
|
[JsonPropertyName("aliases")]
|
|
public object? Aliases { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantCreateLabelParameters
|
|
{
|
|
///<summary>The name of the label to create.</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary>Description for the label.</summary>
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; init; }
|
|
|
|
///<summary>Icon to use for the label.</summary>
|
|
[JsonPropertyName("icon")]
|
|
public object? Icon { get; init; }
|
|
|
|
///<summary>Color to use for the label. Can be a color name from the list, or a hex color code (like #FF0000).</summary>
|
|
[JsonPropertyName("color")]
|
|
public object? Color { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantDeleteAreaParameters
|
|
{
|
|
///<summary>The ID of the area to delete.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public string? AreaId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantDeleteFloorParameters
|
|
{
|
|
///<summary>The ID of the floor to delete.</summary>
|
|
[JsonPropertyName("floor_id")]
|
|
public object? FloorId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantDeleteLabelParameters
|
|
{
|
|
///<summary>The ID of the label to delete.</summary>
|
|
[JsonPropertyName("label_id")]
|
|
public object? LabelId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantDisableConfigEntryParameters
|
|
{
|
|
///<summary>The integration configuration entry to disable.</summary>
|
|
[JsonPropertyName("config_entry_id")]
|
|
public object? ConfigEntryId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantDisableDeviceParameters
|
|
{
|
|
///<summary>The device(s) to disable.</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public IEnumerable<string>? DeviceId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantDisableEntityParameters
|
|
{
|
|
///<summary>The entity/entities to disable.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantDisablePollingParameters
|
|
{
|
|
///<summary>The integration configuration entry to disable polling for.</summary>
|
|
[JsonPropertyName("config_entry_id")]
|
|
public object? ConfigEntryId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantEnableConfigEntryParameters
|
|
{
|
|
///<summary>The integration configuration entry to enable.</summary>
|
|
[JsonPropertyName("config_entry_id")]
|
|
public object? ConfigEntryId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantEnableDeviceParameters
|
|
{
|
|
///<summary>The device(s) to enable.</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public IEnumerable<string>? DeviceId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantEnableEntityParameters
|
|
{
|
|
///<summary>The entity/entities to enable.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantEnablePollingParameters
|
|
{
|
|
///<summary>The integration configuration entry to enable polling for.</summary>
|
|
[JsonPropertyName("config_entry_id")]
|
|
public object? ConfigEntryId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantHideEntityParameters
|
|
{
|
|
///<summary>The entity/entities to hide.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantIgnoreAllDiscoveredParameters
|
|
{
|
|
///<summary>The integration domain to ignore all discovered devices for. If not provided, all domains will be considered to be ignored.</summary>
|
|
[JsonPropertyName("domain")]
|
|
public string? Domain { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantReloadConfigEntryParameters
|
|
{
|
|
///<summary> eg: 8955375327824e14ba89e4b29cc3ec9a</summary>
|
|
[JsonPropertyName("entry_id")]
|
|
public object? EntryId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveAliasFromAreaParameters
|
|
{
|
|
///<summary>The ID of the area to remove the alias from.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public string? AreaId { get; init; }
|
|
|
|
///<summary>The alias (or list of aliasses) to remove from the area.</summary>
|
|
[JsonPropertyName("alias")]
|
|
public object? Alias { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveAliasFromFloorParameters
|
|
{
|
|
///<summary>The ID of the floor to remove the alias from.</summary>
|
|
[JsonPropertyName("floor_id")]
|
|
public object? FloorId { get; init; }
|
|
|
|
///<summary>The alias (or list of aliasses) to remove from the floor.</summary>
|
|
[JsonPropertyName("alias")]
|
|
public object? Alias { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveAreaFromFloorParameters
|
|
{
|
|
///<summary>The ID of the area to remove the floor from.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public IEnumerable<string>? AreaId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveDeviceFromAreaParameters
|
|
{
|
|
///<summary>The ID of the device to remove the area from.</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public IEnumerable<string>? DeviceId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveEntityFromAreaParameters
|
|
{
|
|
///<summary>The ID of the entity (or entities) to remove the area from.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveLabelFromAreaParameters
|
|
{
|
|
///<summary>The ID(s) of the label(s) to remove from the area(s).</summary>
|
|
[JsonPropertyName("label_id")]
|
|
public IEnumerable<object>? LabelId { get; init; }
|
|
|
|
///<summary>The ID(s) of the area(s) to remove the label(s) from.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public IEnumerable<string>? AreaId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveLabelFromDeviceParameters
|
|
{
|
|
///<summary>The ID(s) of the label(s) to remove from the device(s).</summary>
|
|
[JsonPropertyName("label_id")]
|
|
public IEnumerable<object>? LabelId { get; init; }
|
|
|
|
///<summary>The ID(s) of the device(s) to remove the label(s) from.</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public IEnumerable<string>? DeviceId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRemoveLabelFromEntityParameters
|
|
{
|
|
///<summary>The ID(s) of the label(s) to remove from the entity/entities.</summary>
|
|
[JsonPropertyName("label_id")]
|
|
public IEnumerable<object>? LabelId { get; init; }
|
|
|
|
///<summary>The ID(s) of the entity/entities to remove the label(s) from.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRenameEntityParameters
|
|
{
|
|
///<summary>The entity/entities to rename.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
|
|
///<summary>The new name for the entity/entities.</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantRestartParameters
|
|
{
|
|
///<summary>If the restart should be done in safe mode. This will disable all custom integrations and frontend modules.</summary>
|
|
[JsonPropertyName("safe_mode")]
|
|
public bool? SafeMode { get; init; }
|
|
|
|
///<summary>Force the restart. WARNING! This will not gracefully shutdown Home Assistant, it will skip configuration checks and ignore running database migrations. Only use this if you know what you are doing.</summary>
|
|
[JsonPropertyName("force")]
|
|
public bool? Force { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantSetAreaAliasesParameters
|
|
{
|
|
///<summary>The ID of the area to set the aliases for.</summary>
|
|
[JsonPropertyName("area_id")]
|
|
public string? AreaId { get; init; }
|
|
|
|
///<summary>The aliases to set for the area.</summary>
|
|
[JsonPropertyName("aliases")]
|
|
public object? Aliases { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantSetFloorAliasesParameters
|
|
{
|
|
///<summary>The ID of the floor to set the aliases for.</summary>
|
|
[JsonPropertyName("floor_id")]
|
|
public object? FloorId { get; init; }
|
|
|
|
///<summary>The aliases to set for the floor.</summary>
|
|
[JsonPropertyName("aliases")]
|
|
public object? Aliases { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantSetLocationParameters
|
|
{
|
|
///<summary> eg: 32.87336</summary>
|
|
[JsonPropertyName("latitude")]
|
|
public double? Latitude { get; init; }
|
|
|
|
///<summary> eg: 117.22743</summary>
|
|
[JsonPropertyName("longitude")]
|
|
public double? Longitude { get; init; }
|
|
|
|
///<summary> eg: 120</summary>
|
|
[JsonPropertyName("elevation")]
|
|
public double? Elevation { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantUnhideEntityParameters
|
|
{
|
|
///<summary>The entity/entities to unhide.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantUpdateEntityParameters
|
|
{
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record HomeassistantUpdateEntityIdParameters
|
|
{
|
|
///<summary>The entity/entities to update.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
|
|
///<summary>The new ID for the entity</summary>
|
|
[JsonPropertyName("new_entity_id")]
|
|
public string? NewEntityId { get; init; }
|
|
}
|
|
|
|
public partial class HumidifierServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public HumidifierServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetHumidity(ServiceTarget target, HumidifierSetHumidityParameters data)
|
|
{
|
|
_haContext.CallService("humidifier", "set_humidity", target, data);
|
|
}
|
|
|
|
///<param name="humidity"></param>
|
|
public void SetHumidity(ServiceTarget target, long humidity)
|
|
{
|
|
_haContext.CallService("humidifier", "set_humidity", target, new HumidifierSetHumidityParameters { Humidity = humidity });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetMode(ServiceTarget target, HumidifierSetModeParameters data)
|
|
{
|
|
_haContext.CallService("humidifier", "set_mode", target, data);
|
|
}
|
|
|
|
///<param name="mode"> eg: away</param>
|
|
public void SetMode(ServiceTarget target, string mode)
|
|
{
|
|
_haContext.CallService("humidifier", "set_mode", target, new HumidifierSetModeParameters { Mode = mode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("humidifier", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("humidifier", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("humidifier", "turn_on", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record HumidifierSetHumidityParameters
|
|
{
|
|
[JsonPropertyName("humidity")]
|
|
public long? Humidity { get; init; }
|
|
}
|
|
|
|
public partial record HumidifierSetModeParameters
|
|
{
|
|
///<summary> eg: away</summary>
|
|
[JsonPropertyName("mode")]
|
|
public string? Mode { get; init; }
|
|
}
|
|
|
|
public partial class InputBooleanServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputBooleanServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("input_boolean", "reload", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_boolean", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_boolean", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_boolean", "turn_on", target, data);
|
|
}
|
|
}
|
|
|
|
public partial class InputButtonServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputButtonServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Press(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_button", "press", target, data);
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("input_button", "reload", null, data);
|
|
}
|
|
}
|
|
|
|
public partial class InputDatetimeServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputDatetimeServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("input_datetime", "reload", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetDatetime(ServiceTarget target, InputDatetimeSetDatetimeParameters data)
|
|
{
|
|
_haContext.CallService("input_datetime", "set_datetime", target, data);
|
|
}
|
|
|
|
///<param name="date"> eg: "2019-04-20"</param>
|
|
///<param name="time"> eg: "05:04:20"</param>
|
|
///<param name="datetime"> eg: "2019-04-20 05:04:20"</param>
|
|
///<param name="timestamp"></param>
|
|
public void SetDatetime(ServiceTarget target, string? date = null, TimeOnly? time = null, string? datetime = null, long? timestamp = null)
|
|
{
|
|
_haContext.CallService("input_datetime", "set_datetime", target, new InputDatetimeSetDatetimeParameters { Date = date, Time = time, Datetime = datetime, Timestamp = timestamp });
|
|
}
|
|
}
|
|
|
|
public partial record InputDatetimeSetDatetimeParameters
|
|
{
|
|
///<summary> eg: "2019-04-20"</summary>
|
|
[JsonPropertyName("date")]
|
|
public string? Date { get; init; }
|
|
|
|
///<summary> eg: "05:04:20"</summary>
|
|
[JsonPropertyName("time")]
|
|
public TimeOnly? Time { get; init; }
|
|
|
|
///<summary> eg: "2019-04-20 05:04:20"</summary>
|
|
[JsonPropertyName("datetime")]
|
|
public string? Datetime { get; init; }
|
|
|
|
[JsonPropertyName("timestamp")]
|
|
public long? Timestamp { get; init; }
|
|
}
|
|
|
|
public partial class InputNumberServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputNumberServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Decrease an input number entity value by a certain amount.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Decrement(ServiceTarget target, InputNumberDecrementParameters data)
|
|
{
|
|
_haContext.CallService("input_number", "decrement", target, data);
|
|
}
|
|
|
|
///<summary>Decrease an input number entity value by a certain amount.</summary>
|
|
///<param name="amount">The amount to decrease the input number with. If not provided, the step of the number entity will be used.</param>
|
|
public void Decrement(ServiceTarget target, long? amount = null)
|
|
{
|
|
_haContext.CallService("input_number", "decrement", target, new InputNumberDecrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Increase an input number entity value by a certain amount.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Increment(ServiceTarget target, InputNumberIncrementParameters data)
|
|
{
|
|
_haContext.CallService("input_number", "increment", target, data);
|
|
}
|
|
|
|
///<summary>Increase an input number entity value by a certain amount.</summary>
|
|
///<param name="amount">The amount to increase the input number with. If not provided, the step of the number entity will be used.</param>
|
|
public void Increment(ServiceTarget target, long? amount = null)
|
|
{
|
|
_haContext.CallService("input_number", "increment", target, new InputNumberIncrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Set an input number entity to its maximum value.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Max(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_number", "max", target, data);
|
|
}
|
|
|
|
///<summary>Set an input number entity to its minimum value.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Min(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_number", "min", target, data);
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("input_number", "reload", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetValue(ServiceTarget target, InputNumberSetValueParameters data)
|
|
{
|
|
_haContext.CallService("input_number", "set_value", target, data);
|
|
}
|
|
|
|
///<param name="value"></param>
|
|
public void SetValue(ServiceTarget target, double value)
|
|
{
|
|
_haContext.CallService("input_number", "set_value", target, new InputNumberSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public partial record InputNumberDecrementParameters
|
|
{
|
|
///<summary>The amount to decrease the input number with. If not provided, the step of the number entity will be used.</summary>
|
|
[JsonPropertyName("amount")]
|
|
public long? Amount { get; init; }
|
|
}
|
|
|
|
public partial record InputNumberIncrementParameters
|
|
{
|
|
///<summary>The amount to increase the input number with. If not provided, the step of the number entity will be used.</summary>
|
|
[JsonPropertyName("amount")]
|
|
public long? Amount { get; init; }
|
|
}
|
|
|
|
public partial record InputNumberSetValueParameters
|
|
{
|
|
[JsonPropertyName("value")]
|
|
public double? Value { get; init; }
|
|
}
|
|
|
|
public partial class InputSelectServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputSelectServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Select an random option for an input_select entity.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Random(ServiceTarget target, InputSelectRandomParameters data)
|
|
{
|
|
_haContext.CallService("input_select", "random", target, data);
|
|
}
|
|
|
|
///<summary>Select an random option for an input_select entity.</summary>
|
|
///<param name="options">Limits the options to select from. If not provided, all options will be considered.</param>
|
|
public void Random(ServiceTarget target, object? options = null)
|
|
{
|
|
_haContext.CallService("input_select", "random", target, new InputSelectRandomParameters { Options = options });
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("input_select", "reload", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectFirst(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_select", "select_first", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectLast(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_select", "select_last", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectNext(ServiceTarget target, InputSelectSelectNextParameters data)
|
|
{
|
|
_haContext.CallService("input_select", "select_next", target, data);
|
|
}
|
|
|
|
///<param name="cycle"></param>
|
|
public void SelectNext(ServiceTarget target, bool? cycle = null)
|
|
{
|
|
_haContext.CallService("input_select", "select_next", target, new InputSelectSelectNextParameters { Cycle = cycle });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectOption(ServiceTarget target, InputSelectSelectOptionParameters data)
|
|
{
|
|
_haContext.CallService("input_select", "select_option", target, data);
|
|
}
|
|
|
|
///<param name="option"> eg: "Item A"</param>
|
|
public void SelectOption(ServiceTarget target, object option)
|
|
{
|
|
_haContext.CallService("input_select", "select_option", target, new InputSelectSelectOptionParameters { Option = option });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectPrevious(ServiceTarget target, InputSelectSelectPreviousParameters data)
|
|
{
|
|
_haContext.CallService("input_select", "select_previous", target, data);
|
|
}
|
|
|
|
///<param name="cycle"></param>
|
|
public void SelectPrevious(ServiceTarget target, bool? cycle = null)
|
|
{
|
|
_haContext.CallService("input_select", "select_previous", target, new InputSelectSelectPreviousParameters { Cycle = cycle });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetOptions(ServiceTarget target, InputSelectSetOptionsParameters data)
|
|
{
|
|
_haContext.CallService("input_select", "set_options", target, data);
|
|
}
|
|
|
|
///<param name="options"> eg: ["Item A", "Item B", "Item C"]</param>
|
|
public void SetOptions(ServiceTarget target, IEnumerable<string> options)
|
|
{
|
|
_haContext.CallService("input_select", "set_options", target, new InputSelectSetOptionsParameters { Options = options });
|
|
}
|
|
|
|
///<summary>Shuffles the list of selectable options for an `input_select` entity. This is not persistent and will be undone once reloaded or Home Assistant restarts.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Shuffle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_select", "shuffle", target, data);
|
|
}
|
|
|
|
///<summary>Sorts the list of selectable options for an `input_select` entity. This is not persistent and will be undone once reloaded or Home Assistant restarts.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Sort(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("input_select", "sort", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record InputSelectRandomParameters
|
|
{
|
|
///<summary>Limits the options to select from. If not provided, all options will be considered.</summary>
|
|
[JsonPropertyName("options")]
|
|
public object? Options { get; init; }
|
|
}
|
|
|
|
public partial record InputSelectSelectNextParameters
|
|
{
|
|
[JsonPropertyName("cycle")]
|
|
public bool? Cycle { get; init; }
|
|
}
|
|
|
|
public partial record InputSelectSelectOptionParameters
|
|
{
|
|
///<summary> eg: "Item A"</summary>
|
|
[JsonPropertyName("option")]
|
|
public object? Option { get; init; }
|
|
}
|
|
|
|
public partial record InputSelectSelectPreviousParameters
|
|
{
|
|
[JsonPropertyName("cycle")]
|
|
public bool? Cycle { get; init; }
|
|
}
|
|
|
|
public partial record InputSelectSetOptionsParameters
|
|
{
|
|
///<summary> eg: ["Item A", "Item B", "Item C"]</summary>
|
|
[JsonPropertyName("options")]
|
|
public IEnumerable<string>? Options { get; init; }
|
|
}
|
|
|
|
public partial class InputTextServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public InputTextServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("input_text", "reload", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetValue(ServiceTarget target, InputTextSetValueParameters data)
|
|
{
|
|
_haContext.CallService("input_text", "set_value", target, data);
|
|
}
|
|
|
|
///<param name="value"> eg: This is an example text</param>
|
|
public void SetValue(ServiceTarget target, string value)
|
|
{
|
|
_haContext.CallService("input_text", "set_value", target, new InputTextSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public partial record InputTextSetValueParameters
|
|
{
|
|
///<summary> eg: This is an example text</summary>
|
|
[JsonPropertyName("value")]
|
|
public string? Value { get; init; }
|
|
}
|
|
|
|
public partial class LightServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public LightServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, LightToggleParameters data)
|
|
{
|
|
_haContext.CallService("light", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="transition"></param>
|
|
///<param name="rgbColor"> eg: [255, 100, 100]</param>
|
|
///<param name="colorTempKelvin"></param>
|
|
///<param name="brightnessPct"></param>
|
|
///<param name="effect"></param>
|
|
///<param name="rgbwColor"> eg: [255, 100, 100, 50]</param>
|
|
///<param name="rgbwwColor"> eg: [255, 100, 100, 50, 70]</param>
|
|
///<param name="colorName"></param>
|
|
///<param name="hsColor"> eg: [300, 70]</param>
|
|
///<param name="xyColor"> eg: [0.52, 0.43]</param>
|
|
///<param name="brightness"></param>
|
|
///<param name="white"></param>
|
|
///<param name="profile"> eg: relax</param>
|
|
///<param name="flash"></param>
|
|
public void Toggle(ServiceTarget target, long? transition = null, IReadOnlyCollection<int>? rgbColor = null, object? colorTempKelvin = null, long? brightnessPct = null, string? effect = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, long? brightness = null, object? white = null, string? profile = null, object? flash = null)
|
|
{
|
|
_haContext.CallService("light", "toggle", target, new LightToggleParameters { Transition = transition, RgbColor = rgbColor, ColorTempKelvin = colorTempKelvin, BrightnessPct = brightnessPct, Effect = effect, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, Brightness = brightness, White = white, Profile = profile, Flash = flash });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, LightTurnOffParameters data)
|
|
{
|
|
_haContext.CallService("light", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="transition"></param>
|
|
///<param name="flash"></param>
|
|
public void TurnOff(ServiceTarget target, long? transition = null, object? flash = null)
|
|
{
|
|
_haContext.CallService("light", "turn_off", target, new LightTurnOffParameters { Transition = transition, Flash = flash });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, LightTurnOnParameters data)
|
|
{
|
|
_haContext.CallService("light", "turn_on", target, data);
|
|
}
|
|
|
|
///<param name="transition"></param>
|
|
///<param name="rgbColor"> eg: [255, 100, 100]</param>
|
|
///<param name="colorTempKelvin"></param>
|
|
///<param name="brightnessPct"></param>
|
|
///<param name="brightnessStepPct"></param>
|
|
///<param name="effect"></param>
|
|
///<param name="rgbwColor"> eg: [255, 100, 100, 50]</param>
|
|
///<param name="rgbwwColor"> eg: [255, 100, 100, 50, 70]</param>
|
|
///<param name="colorName"></param>
|
|
///<param name="hsColor"> eg: [300, 70]</param>
|
|
///<param name="xyColor"> eg: [0.52, 0.43]</param>
|
|
///<param name="brightness"></param>
|
|
///<param name="brightnessStep"></param>
|
|
///<param name="white"></param>
|
|
///<param name="profile"> eg: relax</param>
|
|
///<param name="flash"></param>
|
|
public void TurnOn(ServiceTarget target, long? transition = null, IReadOnlyCollection<int>? rgbColor = null, object? colorTempKelvin = null, long? brightnessPct = null, long? brightnessStepPct = null, string? effect = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, long? brightness = null, long? brightnessStep = null, object? white = null, string? profile = null, object? flash = null)
|
|
{
|
|
_haContext.CallService("light", "turn_on", target, new LightTurnOnParameters { Transition = transition, RgbColor = rgbColor, ColorTempKelvin = colorTempKelvin, BrightnessPct = brightnessPct, BrightnessStepPct = brightnessStepPct, Effect = effect, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, Brightness = brightness, BrightnessStep = brightnessStep, White = white, Profile = profile, Flash = flash });
|
|
}
|
|
}
|
|
|
|
public partial record LightToggleParameters
|
|
{
|
|
[JsonPropertyName("transition")]
|
|
public long? Transition { get; init; }
|
|
|
|
///<summary> eg: [255, 100, 100]</summary>
|
|
[JsonPropertyName("rgb_color")]
|
|
public IReadOnlyCollection<int>? RgbColor { get; init; }
|
|
|
|
[JsonPropertyName("color_temp_kelvin")]
|
|
public object? ColorTempKelvin { get; init; }
|
|
|
|
[JsonPropertyName("brightness_pct")]
|
|
public long? BrightnessPct { get; init; }
|
|
|
|
[JsonPropertyName("effect")]
|
|
public string? Effect { get; init; }
|
|
|
|
///<summary> eg: [255, 100, 100, 50]</summary>
|
|
[JsonPropertyName("rgbw_color")]
|
|
public object? RgbwColor { get; init; }
|
|
|
|
///<summary> eg: [255, 100, 100, 50, 70]</summary>
|
|
[JsonPropertyName("rgbww_color")]
|
|
public object? RgbwwColor { get; init; }
|
|
|
|
[JsonPropertyName("color_name")]
|
|
public object? ColorName { get; init; }
|
|
|
|
///<summary> eg: [300, 70]</summary>
|
|
[JsonPropertyName("hs_color")]
|
|
public object? HsColor { get; init; }
|
|
|
|
///<summary> eg: [0.52, 0.43]</summary>
|
|
[JsonPropertyName("xy_color")]
|
|
public object? XyColor { get; init; }
|
|
|
|
[JsonPropertyName("brightness")]
|
|
public long? Brightness { get; init; }
|
|
|
|
[JsonPropertyName("white")]
|
|
public object? White { get; init; }
|
|
|
|
///<summary> eg: relax</summary>
|
|
[JsonPropertyName("profile")]
|
|
public string? Profile { get; init; }
|
|
|
|
[JsonPropertyName("flash")]
|
|
public object? Flash { get; init; }
|
|
}
|
|
|
|
public partial record LightTurnOffParameters
|
|
{
|
|
[JsonPropertyName("transition")]
|
|
public long? Transition { get; init; }
|
|
|
|
[JsonPropertyName("flash")]
|
|
public object? Flash { get; init; }
|
|
}
|
|
|
|
public partial record LightTurnOnParameters
|
|
{
|
|
[JsonPropertyName("transition")]
|
|
public long? Transition { get; init; }
|
|
|
|
///<summary> eg: [255, 100, 100]</summary>
|
|
[JsonPropertyName("rgb_color")]
|
|
public IReadOnlyCollection<int>? RgbColor { get; init; }
|
|
|
|
[JsonPropertyName("color_temp_kelvin")]
|
|
public object? ColorTempKelvin { get; init; }
|
|
|
|
[JsonPropertyName("brightness_pct")]
|
|
public long? BrightnessPct { get; init; }
|
|
|
|
[JsonPropertyName("brightness_step_pct")]
|
|
public long? BrightnessStepPct { get; init; }
|
|
|
|
[JsonPropertyName("effect")]
|
|
public string? Effect { get; init; }
|
|
|
|
///<summary> eg: [255, 100, 100, 50]</summary>
|
|
[JsonPropertyName("rgbw_color")]
|
|
public object? RgbwColor { get; init; }
|
|
|
|
///<summary> eg: [255, 100, 100, 50, 70]</summary>
|
|
[JsonPropertyName("rgbww_color")]
|
|
public object? RgbwwColor { get; init; }
|
|
|
|
[JsonPropertyName("color_name")]
|
|
public object? ColorName { get; init; }
|
|
|
|
///<summary> eg: [300, 70]</summary>
|
|
[JsonPropertyName("hs_color")]
|
|
public object? HsColor { get; init; }
|
|
|
|
///<summary> eg: [0.52, 0.43]</summary>
|
|
[JsonPropertyName("xy_color")]
|
|
public object? XyColor { get; init; }
|
|
|
|
[JsonPropertyName("brightness")]
|
|
public long? Brightness { get; init; }
|
|
|
|
[JsonPropertyName("brightness_step")]
|
|
public long? BrightnessStep { get; init; }
|
|
|
|
[JsonPropertyName("white")]
|
|
public object? White { get; init; }
|
|
|
|
///<summary> eg: relax</summary>
|
|
[JsonPropertyName("profile")]
|
|
public string? Profile { get; init; }
|
|
|
|
[JsonPropertyName("flash")]
|
|
public object? Flash { get; init; }
|
|
}
|
|
|
|
public partial class LocaltuyaServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public LocaltuyaServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Reload localtuya and reconnect to all devices.</summary>
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("localtuya", "reload", null, data);
|
|
}
|
|
|
|
///<summary>Change the value of a datapoint (DP)</summary>
|
|
public void SetDp(LocaltuyaSetDpParameters data)
|
|
{
|
|
_haContext.CallService("localtuya", "set_dp", null, data);
|
|
}
|
|
|
|
///<summary>Change the value of a datapoint (DP)</summary>
|
|
///<param name="deviceId">Device ID of device to change datapoint value for eg: 11100118278aab4de001</param>
|
|
///<param name="dp">Datapoint index eg: 1</param>
|
|
///<param name="value">New value to set eg: False</param>
|
|
public void SetDp(object? deviceId = null, object? dp = null, object? value = null)
|
|
{
|
|
_haContext.CallService("localtuya", "set_dp", null, new LocaltuyaSetDpParameters { DeviceId = deviceId, Dp = dp, Value = value });
|
|
}
|
|
}
|
|
|
|
public partial record LocaltuyaSetDpParameters
|
|
{
|
|
///<summary>Device ID of device to change datapoint value for eg: 11100118278aab4de001</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public object? DeviceId { get; init; }
|
|
|
|
///<summary>Datapoint index eg: 1</summary>
|
|
[JsonPropertyName("dp")]
|
|
public object? Dp { get; init; }
|
|
|
|
///<summary>New value to set eg: False</summary>
|
|
[JsonPropertyName("value")]
|
|
public object? Value { get; init; }
|
|
}
|
|
|
|
public partial class LockServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public LockServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Lock(ServiceTarget target, LockLockParameters data)
|
|
{
|
|
_haContext.CallService("lock", "lock", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void Lock(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("lock", "lock", target, new LockLockParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Open(ServiceTarget target, LockOpenParameters data)
|
|
{
|
|
_haContext.CallService("lock", "open", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void Open(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("lock", "open", target, new LockOpenParameters { Code = code });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Unlock(ServiceTarget target, LockUnlockParameters data)
|
|
{
|
|
_haContext.CallService("lock", "unlock", target, data);
|
|
}
|
|
|
|
///<param name="code"> eg: 1234</param>
|
|
public void Unlock(ServiceTarget target, string? code = null)
|
|
{
|
|
_haContext.CallService("lock", "unlock", target, new LockUnlockParameters { Code = code });
|
|
}
|
|
}
|
|
|
|
public partial record LockLockParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record LockOpenParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial record LockUnlockParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
}
|
|
|
|
public partial class LogbookServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public LogbookServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Log(LogbookLogParameters data)
|
|
{
|
|
_haContext.CallService("logbook", "log", null, data);
|
|
}
|
|
|
|
///<param name="name"> eg: Kitchen</param>
|
|
///<param name="message"> eg: is being used</param>
|
|
///<param name="entityId"></param>
|
|
///<param name="domain"> eg: light</param>
|
|
public void Log(string name, string message, string? entityId = null, string? domain = null)
|
|
{
|
|
_haContext.CallService("logbook", "log", null, new LogbookLogParameters { Name = name, Message = message, EntityId = entityId, Domain = domain });
|
|
}
|
|
}
|
|
|
|
public partial record LogbookLogParameters
|
|
{
|
|
///<summary> eg: Kitchen</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary> eg: is being used</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
|
|
///<summary> eg: light</summary>
|
|
[JsonPropertyName("domain")]
|
|
public string? Domain { get; init; }
|
|
}
|
|
|
|
public partial class LoggerServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public LoggerServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void SetDefaultLevel(LoggerSetDefaultLevelParameters data)
|
|
{
|
|
_haContext.CallService("logger", "set_default_level", null, data);
|
|
}
|
|
|
|
///<param name="level"></param>
|
|
public void SetDefaultLevel(object? level = null)
|
|
{
|
|
_haContext.CallService("logger", "set_default_level", null, new LoggerSetDefaultLevelParameters { Level = level });
|
|
}
|
|
|
|
public void SetLevel(object? data = null)
|
|
{
|
|
_haContext.CallService("logger", "set_level", null, data);
|
|
}
|
|
}
|
|
|
|
public partial record LoggerSetDefaultLevelParameters
|
|
{
|
|
[JsonPropertyName("level")]
|
|
public object? Level { get; init; }
|
|
}
|
|
|
|
public partial class MediaPlayerServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public MediaPlayerServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void BrowseMedia(ServiceTarget target, MediaPlayerBrowseMediaParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "browse_media", target, data);
|
|
}
|
|
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
public void BrowseMedia(ServiceTarget target, string? mediaContentType = null, string? mediaContentId = null)
|
|
{
|
|
_haContext.CallService("media_player", "browse_media", target, new MediaPlayerBrowseMediaParameters { MediaContentType = mediaContentType, MediaContentId = mediaContentId });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public Task<JsonElement?> BrowseMediaAsync(ServiceTarget target, MediaPlayerBrowseMediaParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("media_player", "browse_media", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
public Task<JsonElement?> BrowseMediaAsync(ServiceTarget target, string? mediaContentType = null, string? mediaContentId = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("media_player", "browse_media", target, new MediaPlayerBrowseMediaParameters { MediaContentType = mediaContentType, MediaContentId = mediaContentId });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void ClearPlaylist(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "clear_playlist", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Join(ServiceTarget target, MediaPlayerJoinParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "join", target, data);
|
|
}
|
|
|
|
///<param name="groupMembers"> eg: - media_player.multiroom_player2 - media_player.multiroom_player3 </param>
|
|
public void Join(ServiceTarget target, IEnumerable<string> groupMembers)
|
|
{
|
|
_haContext.CallService("media_player", "join", target, new MediaPlayerJoinParameters { GroupMembers = groupMembers });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void MediaNextTrack(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "media_next_track", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void MediaPause(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "media_pause", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void MediaPlay(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "media_play", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void MediaPlayPause(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "media_play_pause", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void MediaPreviousTrack(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "media_previous_track", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void MediaSeek(ServiceTarget target, MediaPlayerMediaSeekParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "media_seek", target, data);
|
|
}
|
|
|
|
///<param name="seekPosition"></param>
|
|
public void MediaSeek(ServiceTarget target, double seekPosition)
|
|
{
|
|
_haContext.CallService("media_player", "media_seek", target, new MediaPlayerMediaSeekParameters { SeekPosition = seekPosition });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void MediaStop(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "media_stop", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void PlayMedia(ServiceTarget target, MediaPlayerPlayMediaParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "play_media", target, data);
|
|
}
|
|
|
|
///<param name="media"> eg: {"media_content_id": "https://home-assistant.io/images/cast/splash.png", "media_content_type": "music"}</param>
|
|
///<param name="enqueue"></param>
|
|
///<param name="announce"> eg: true</param>
|
|
public void PlayMedia(ServiceTarget target, object media, object? enqueue = null, bool? announce = null)
|
|
{
|
|
_haContext.CallService("media_player", "play_media", target, new MediaPlayerPlayMediaParameters { Media = media, Enqueue = enqueue, Announce = announce });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void RepeatSet(ServiceTarget target, MediaPlayerRepeatSetParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "repeat_set", target, data);
|
|
}
|
|
|
|
///<param name="repeat"></param>
|
|
public void RepeatSet(ServiceTarget target, object repeat)
|
|
{
|
|
_haContext.CallService("media_player", "repeat_set", target, new MediaPlayerRepeatSetParameters { Repeat = repeat });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SearchMedia(ServiceTarget target, MediaPlayerSearchMediaParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "search_media", target, data);
|
|
}
|
|
|
|
///<param name="searchQuery"> eg: Beatles</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
///<param name="mediaFilterClasses"> eg: ["album","artist"]</param>
|
|
public void SearchMedia(ServiceTarget target, string searchQuery, string? mediaContentType = null, string? mediaContentId = null, IEnumerable<string>? mediaFilterClasses = null)
|
|
{
|
|
_haContext.CallService("media_player", "search_media", target, new MediaPlayerSearchMediaParameters { SearchQuery = searchQuery, MediaContentType = mediaContentType, MediaContentId = mediaContentId, MediaFilterClasses = mediaFilterClasses });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public Task<JsonElement?> SearchMediaAsync(ServiceTarget target, MediaPlayerSearchMediaParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("media_player", "search_media", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
///<param name="searchQuery"> eg: Beatles</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
///<param name="mediaFilterClasses"> eg: ["album","artist"]</param>
|
|
public Task<JsonElement?> SearchMediaAsync(ServiceTarget target, string searchQuery, string? mediaContentType = null, string? mediaContentId = null, IEnumerable<string>? mediaFilterClasses = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("media_player", "search_media", target, new MediaPlayerSearchMediaParameters { SearchQuery = searchQuery, MediaContentType = mediaContentType, MediaContentId = mediaContentId, MediaFilterClasses = mediaFilterClasses });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectSoundMode(ServiceTarget target, MediaPlayerSelectSoundModeParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "select_sound_mode", target, data);
|
|
}
|
|
|
|
///<param name="soundMode"> eg: Music</param>
|
|
public void SelectSoundMode(ServiceTarget target, string? soundMode = null)
|
|
{
|
|
_haContext.CallService("media_player", "select_sound_mode", target, new MediaPlayerSelectSoundModeParameters { SoundMode = soundMode });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectSource(ServiceTarget target, MediaPlayerSelectSourceParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "select_source", target, data);
|
|
}
|
|
|
|
///<param name="source"> eg: video1</param>
|
|
public void SelectSource(ServiceTarget target, string source)
|
|
{
|
|
_haContext.CallService("media_player", "select_source", target, new MediaPlayerSelectSourceParameters { Source = source });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void ShuffleSet(ServiceTarget target, MediaPlayerShuffleSetParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "shuffle_set", target, data);
|
|
}
|
|
|
|
///<param name="shuffle"></param>
|
|
public void ShuffleSet(ServiceTarget target, bool shuffle)
|
|
{
|
|
_haContext.CallService("media_player", "shuffle_set", target, new MediaPlayerShuffleSetParameters { Shuffle = shuffle });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "turn_on", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Unjoin(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "unjoin", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void VolumeDown(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "volume_down", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void VolumeMute(ServiceTarget target, MediaPlayerVolumeMuteParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "volume_mute", target, data);
|
|
}
|
|
|
|
///<param name="isVolumeMuted"></param>
|
|
public void VolumeMute(ServiceTarget target, bool isVolumeMuted)
|
|
{
|
|
_haContext.CallService("media_player", "volume_mute", target, new MediaPlayerVolumeMuteParameters { IsVolumeMuted = isVolumeMuted });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void VolumeSet(ServiceTarget target, MediaPlayerVolumeSetParameters data)
|
|
{
|
|
_haContext.CallService("media_player", "volume_set", target, data);
|
|
}
|
|
|
|
///<param name="volumeLevel"></param>
|
|
public void VolumeSet(ServiceTarget target, double volumeLevel)
|
|
{
|
|
_haContext.CallService("media_player", "volume_set", target, new MediaPlayerVolumeSetParameters { VolumeLevel = volumeLevel });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void VolumeUp(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("media_player", "volume_up", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record MediaPlayerBrowseMediaParameters
|
|
{
|
|
///<summary> eg: music</summary>
|
|
[JsonPropertyName("media_content_type")]
|
|
public string? MediaContentType { get; init; }
|
|
|
|
///<summary> eg: A:ALBUMARTIST/Beatles</summary>
|
|
[JsonPropertyName("media_content_id")]
|
|
public string? MediaContentId { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerJoinParameters
|
|
{
|
|
///<summary> eg: - media_player.multiroom_player2 - media_player.multiroom_player3 </summary>
|
|
[JsonPropertyName("group_members")]
|
|
public IEnumerable<string>? GroupMembers { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerMediaSeekParameters
|
|
{
|
|
[JsonPropertyName("seek_position")]
|
|
public double? SeekPosition { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerPlayMediaParameters
|
|
{
|
|
///<summary> eg: {"media_content_id": "https://home-assistant.io/images/cast/splash.png", "media_content_type": "music"}</summary>
|
|
[JsonPropertyName("media")]
|
|
public object? Media { get; init; }
|
|
|
|
[JsonPropertyName("enqueue")]
|
|
public object? Enqueue { get; init; }
|
|
|
|
///<summary> eg: true</summary>
|
|
[JsonPropertyName("announce")]
|
|
public bool? Announce { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerRepeatSetParameters
|
|
{
|
|
[JsonPropertyName("repeat")]
|
|
public object? Repeat { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerSearchMediaParameters
|
|
{
|
|
///<summary> eg: Beatles</summary>
|
|
[JsonPropertyName("search_query")]
|
|
public string? SearchQuery { get; init; }
|
|
|
|
///<summary> eg: music</summary>
|
|
[JsonPropertyName("media_content_type")]
|
|
public string? MediaContentType { get; init; }
|
|
|
|
///<summary> eg: A:ALBUMARTIST/Beatles</summary>
|
|
[JsonPropertyName("media_content_id")]
|
|
public string? MediaContentId { get; init; }
|
|
|
|
///<summary> eg: ["album","artist"]</summary>
|
|
[JsonPropertyName("media_filter_classes")]
|
|
public IEnumerable<string>? MediaFilterClasses { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerSelectSoundModeParameters
|
|
{
|
|
///<summary> eg: Music</summary>
|
|
[JsonPropertyName("sound_mode")]
|
|
public string? SoundMode { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerSelectSourceParameters
|
|
{
|
|
///<summary> eg: video1</summary>
|
|
[JsonPropertyName("source")]
|
|
public string? Source { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerShuffleSetParameters
|
|
{
|
|
[JsonPropertyName("shuffle")]
|
|
public bool? Shuffle { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerVolumeMuteParameters
|
|
{
|
|
[JsonPropertyName("is_volume_muted")]
|
|
public bool? IsVolumeMuted { get; init; }
|
|
}
|
|
|
|
public partial record MediaPlayerVolumeSetParameters
|
|
{
|
|
[JsonPropertyName("volume_level")]
|
|
public double? VolumeLevel { get; init; }
|
|
}
|
|
|
|
public partial class MqttServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public MqttServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Dump(MqttDumpParameters data)
|
|
{
|
|
_haContext.CallService("mqtt", "dump", null, data);
|
|
}
|
|
|
|
///<param name="topic"> eg: OpenZWave/#</param>
|
|
///<param name="duration"></param>
|
|
public void Dump(string? topic = null, long? duration = null)
|
|
{
|
|
_haContext.CallService("mqtt", "dump", null, new MqttDumpParameters { Topic = topic, Duration = duration });
|
|
}
|
|
|
|
public void Publish(MqttPublishParameters data)
|
|
{
|
|
_haContext.CallService("mqtt", "publish", null, data);
|
|
}
|
|
|
|
///<param name="topic"> eg: /homeassistant/hello</param>
|
|
///<param name="payload"> eg: The temperature is {{ states('sensor.temperature') }}</param>
|
|
///<param name="evaluatePayload"></param>
|
|
///<param name="qos"></param>
|
|
///<param name="retain"></param>
|
|
public void Publish(string topic, object? payload = null, bool? evaluatePayload = null, object? qos = null, bool? retain = null)
|
|
{
|
|
_haContext.CallService("mqtt", "publish", null, new MqttPublishParameters { Topic = topic, Payload = payload, EvaluatePayload = evaluatePayload, Qos = qos, Retain = retain });
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("mqtt", "reload", null, data);
|
|
}
|
|
}
|
|
|
|
public partial record MqttDumpParameters
|
|
{
|
|
///<summary> eg: OpenZWave/#</summary>
|
|
[JsonPropertyName("topic")]
|
|
public string? Topic { get; init; }
|
|
|
|
[JsonPropertyName("duration")]
|
|
public long? Duration { get; init; }
|
|
}
|
|
|
|
public partial record MqttPublishParameters
|
|
{
|
|
///<summary> eg: /homeassistant/hello</summary>
|
|
[JsonPropertyName("topic")]
|
|
public string? Topic { get; init; }
|
|
|
|
///<summary> eg: The temperature is {{ states('sensor.temperature') }}</summary>
|
|
[JsonPropertyName("payload")]
|
|
public object? Payload { get; init; }
|
|
|
|
[JsonPropertyName("evaluate_payload")]
|
|
public bool? EvaluatePayload { get; init; }
|
|
|
|
[JsonPropertyName("qos")]
|
|
public object? Qos { get; init; }
|
|
|
|
[JsonPropertyName("retain")]
|
|
public bool? Retain { get; init; }
|
|
}
|
|
|
|
public partial class NordpoolServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public NordpoolServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void GetPriceIndicesForDate(NordpoolGetPriceIndicesForDateParameters data)
|
|
{
|
|
_haContext.CallService("nordpool", "get_price_indices_for_date", null, data);
|
|
}
|
|
|
|
///<param name="configEntry"></param>
|
|
///<param name="date"></param>
|
|
///<param name="areas"></param>
|
|
///<param name="currency"></param>
|
|
///<param name="resolution"></param>
|
|
public void GetPriceIndicesForDate(object configEntry, DateOnly date, object? areas = null, object? currency = null, object? resolution = null)
|
|
{
|
|
_haContext.CallService("nordpool", "get_price_indices_for_date", null, new NordpoolGetPriceIndicesForDateParameters { ConfigEntry = configEntry, Date = date, Areas = areas, Currency = currency, Resolution = resolution });
|
|
}
|
|
|
|
public Task<JsonElement?> GetPriceIndicesForDateAsync(NordpoolGetPriceIndicesForDateParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("nordpool", "get_price_indices_for_date", null, data);
|
|
}
|
|
|
|
///<param name="configEntry"></param>
|
|
///<param name="date"></param>
|
|
///<param name="areas"></param>
|
|
///<param name="currency"></param>
|
|
///<param name="resolution"></param>
|
|
public Task<JsonElement?> GetPriceIndicesForDateAsync(object configEntry, DateOnly date, object? areas = null, object? currency = null, object? resolution = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("nordpool", "get_price_indices_for_date", null, new NordpoolGetPriceIndicesForDateParameters { ConfigEntry = configEntry, Date = date, Areas = areas, Currency = currency, Resolution = resolution });
|
|
}
|
|
|
|
public void GetPricesForDate(NordpoolGetPricesForDateParameters data)
|
|
{
|
|
_haContext.CallService("nordpool", "get_prices_for_date", null, data);
|
|
}
|
|
|
|
///<param name="configEntry"></param>
|
|
///<param name="date"></param>
|
|
///<param name="areas"></param>
|
|
///<param name="currency"></param>
|
|
public void GetPricesForDate(object configEntry, DateOnly date, object? areas = null, object? currency = null)
|
|
{
|
|
_haContext.CallService("nordpool", "get_prices_for_date", null, new NordpoolGetPricesForDateParameters { ConfigEntry = configEntry, Date = date, Areas = areas, Currency = currency });
|
|
}
|
|
|
|
public Task<JsonElement?> GetPricesForDateAsync(NordpoolGetPricesForDateParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("nordpool", "get_prices_for_date", null, data);
|
|
}
|
|
|
|
///<param name="configEntry"></param>
|
|
///<param name="date"></param>
|
|
///<param name="areas"></param>
|
|
///<param name="currency"></param>
|
|
public Task<JsonElement?> GetPricesForDateAsync(object configEntry, DateOnly date, object? areas = null, object? currency = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("nordpool", "get_prices_for_date", null, new NordpoolGetPricesForDateParameters { ConfigEntry = configEntry, Date = date, Areas = areas, Currency = currency });
|
|
}
|
|
}
|
|
|
|
public partial record NordpoolGetPriceIndicesForDateParameters
|
|
{
|
|
[JsonPropertyName("config_entry")]
|
|
public object? ConfigEntry { get; init; }
|
|
|
|
[JsonPropertyName("date")]
|
|
public DateOnly? Date { get; init; }
|
|
|
|
[JsonPropertyName("areas")]
|
|
public object? Areas { get; init; }
|
|
|
|
[JsonPropertyName("currency")]
|
|
public object? Currency { get; init; }
|
|
|
|
[JsonPropertyName("resolution")]
|
|
public object? Resolution { get; init; }
|
|
}
|
|
|
|
public partial record NordpoolGetPricesForDateParameters
|
|
{
|
|
[JsonPropertyName("config_entry")]
|
|
public object? ConfigEntry { get; init; }
|
|
|
|
[JsonPropertyName("date")]
|
|
public DateOnly? Date { get; init; }
|
|
|
|
[JsonPropertyName("areas")]
|
|
public object? Areas { get; init; }
|
|
|
|
[JsonPropertyName("currency")]
|
|
public object? Currency { get; init; }
|
|
}
|
|
|
|
public partial class NotifyServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public NotifyServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_erika_s_iphone integration.</summary>
|
|
public void MobileAppErikaSIphone(NotifyMobileAppErikaSIphoneParameters data)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_erika_s_iphone", null, data);
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_erika_s_iphone integration.</summary>
|
|
///<param name="message"> eg: The garage door has been open for 10 minutes.</param>
|
|
///<param name="title"> eg: Your Garage Door Friend</param>
|
|
///<param name="target"> eg: platform specific</param>
|
|
///<param name="data"> eg: platform specific</param>
|
|
public void MobileAppErikaSIphone(string message, string? title = null, object? target = null, object? data = null)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_erika_s_iphone", null, new NotifyMobileAppErikaSIphoneParameters { Message = message, Title = title, Target = target, Data = data });
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_home_phone integration.</summary>
|
|
public void MobileAppHomePhone(NotifyMobileAppHomePhoneParameters data)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_home_phone", null, data);
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_home_phone integration.</summary>
|
|
///<param name="message"> eg: The garage door has been open for 10 minutes.</param>
|
|
///<param name="title"> eg: Your Garage Door Friend</param>
|
|
///<param name="target"> eg: platform specific</param>
|
|
///<param name="data"> eg: platform specific</param>
|
|
public void MobileAppHomePhone(string message, string? title = null, object? target = null, object? data = null)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_home_phone", null, new NotifyMobileAppHomePhoneParameters { Message = message, Title = title, Target = target, Data = data });
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_marius_phone integration.</summary>
|
|
public void MobileAppMariusPhone(NotifyMobileAppMariusPhoneParameters data)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_marius_phone", null, data);
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_marius_phone integration.</summary>
|
|
///<param name="message"> eg: The garage door has been open for 10 minutes.</param>
|
|
///<param name="title"> eg: Your Garage Door Friend</param>
|
|
///<param name="target"> eg: platform specific</param>
|
|
///<param name="data"> eg: platform specific</param>
|
|
public void MobileAppMariusPhone(string message, string? title = null, object? target = null, object? data = null)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_marius_phone", null, new NotifyMobileAppMariusPhoneParameters { Message = message, Title = title, Target = target, Data = data });
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_marius_watch integration.</summary>
|
|
public void MobileAppMariusWatch(NotifyMobileAppMariusWatchParameters data)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_marius_watch", null, data);
|
|
}
|
|
|
|
///<summary>Sends a notification message using the mobile_app_marius_watch integration.</summary>
|
|
///<param name="message"> eg: The garage door has been open for 10 minutes.</param>
|
|
///<param name="title"> eg: Your Garage Door Friend</param>
|
|
///<param name="target"> eg: platform specific</param>
|
|
///<param name="data"> eg: platform specific</param>
|
|
public void MobileAppMariusWatch(string message, string? title = null, object? target = null, object? data = null)
|
|
{
|
|
_haContext.CallService("notify", "mobile_app_marius_watch", null, new NotifyMobileAppMariusWatchParameters { Message = message, Title = title, Target = target, Data = data });
|
|
}
|
|
|
|
///<summary>Sends a notification message using the notify service.</summary>
|
|
public void Notify(NotifyNotifyParameters data)
|
|
{
|
|
_haContext.CallService("notify", "notify", null, data);
|
|
}
|
|
|
|
///<summary>Sends a notification message using the notify service.</summary>
|
|
///<param name="message"> eg: The garage door has been open for 10 minutes.</param>
|
|
///<param name="title"> eg: Your Garage Door Friend</param>
|
|
///<param name="target"> eg: platform specific</param>
|
|
///<param name="data"> eg: platform specific</param>
|
|
public void Notify(string message, string? title = null, object? target = null, object? data = null)
|
|
{
|
|
_haContext.CallService("notify", "notify", null, new NotifyNotifyParameters { Message = message, Title = title, Target = target, Data = data });
|
|
}
|
|
|
|
public void PersistentNotification(NotifyPersistentNotificationParameters data)
|
|
{
|
|
_haContext.CallService("notify", "persistent_notification", null, data);
|
|
}
|
|
|
|
///<param name="message"> eg: The garage door has been open for 10 minutes.</param>
|
|
///<param name="title"> eg: Your Garage Door Friend</param>
|
|
///<param name="data"> eg: platform specific</param>
|
|
public void PersistentNotification(string message, string? title = null, object? data = null)
|
|
{
|
|
_haContext.CallService("notify", "persistent_notification", null, new NotifyPersistentNotificationParameters { Message = message, Title = title, Data = data });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SendMessage(ServiceTarget target, NotifySendMessageParameters data)
|
|
{
|
|
_haContext.CallService("notify", "send_message", target, data);
|
|
}
|
|
|
|
///<param name="message"></param>
|
|
///<param name="title"></param>
|
|
public void SendMessage(ServiceTarget target, string message, string? title = null)
|
|
{
|
|
_haContext.CallService("notify", "send_message", target, new NotifySendMessageParameters { Message = message, Title = title });
|
|
}
|
|
}
|
|
|
|
public partial record NotifyMobileAppErikaSIphoneParameters
|
|
{
|
|
///<summary> eg: The garage door has been open for 10 minutes.</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
///<summary> eg: Your Garage Door Friend</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("target")]
|
|
public object? Target { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("data")]
|
|
public object? Data { get; init; }
|
|
}
|
|
|
|
public partial record NotifyMobileAppHomePhoneParameters
|
|
{
|
|
///<summary> eg: The garage door has been open for 10 minutes.</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
///<summary> eg: Your Garage Door Friend</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("target")]
|
|
public object? Target { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("data")]
|
|
public object? Data { get; init; }
|
|
}
|
|
|
|
public partial record NotifyMobileAppMariusPhoneParameters
|
|
{
|
|
///<summary> eg: The garage door has been open for 10 minutes.</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
///<summary> eg: Your Garage Door Friend</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("target")]
|
|
public object? Target { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("data")]
|
|
public object? Data { get; init; }
|
|
}
|
|
|
|
public partial record NotifyMobileAppMariusWatchParameters
|
|
{
|
|
///<summary> eg: The garage door has been open for 10 minutes.</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
///<summary> eg: Your Garage Door Friend</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("target")]
|
|
public object? Target { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("data")]
|
|
public object? Data { get; init; }
|
|
}
|
|
|
|
public partial record NotifyNotifyParameters
|
|
{
|
|
///<summary> eg: The garage door has been open for 10 minutes.</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
///<summary> eg: Your Garage Door Friend</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("target")]
|
|
public object? Target { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("data")]
|
|
public object? Data { get; init; }
|
|
}
|
|
|
|
public partial record NotifyPersistentNotificationParameters
|
|
{
|
|
///<summary> eg: The garage door has been open for 10 minutes.</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
///<summary> eg: Your Garage Door Friend</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("data")]
|
|
public object? Data { get; init; }
|
|
}
|
|
|
|
public partial record NotifySendMessageParameters
|
|
{
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
}
|
|
|
|
public partial class NumberServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public NumberServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Decrease a number entity value by a certain amount.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Decrement(ServiceTarget target, NumberDecrementParameters data)
|
|
{
|
|
_haContext.CallService("number", "decrement", target, data);
|
|
}
|
|
|
|
///<summary>Decrease a number entity value by a certain amount.</summary>
|
|
///<param name="amount">The amount to decrease the number with. If not provided, the step of the number entity will be used.</param>
|
|
public void Decrement(ServiceTarget target, long? amount = null)
|
|
{
|
|
_haContext.CallService("number", "decrement", target, new NumberDecrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Increase a number entity value by a certain amount.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Increment(ServiceTarget target, NumberIncrementParameters data)
|
|
{
|
|
_haContext.CallService("number", "increment", target, data);
|
|
}
|
|
|
|
///<summary>Increase a number entity value by a certain amount.</summary>
|
|
///<param name="amount">The amount to increase the number with. If not provided, the step of the number entity will be used.</param>
|
|
public void Increment(ServiceTarget target, long? amount = null)
|
|
{
|
|
_haContext.CallService("number", "increment", target, new NumberIncrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Set a number entity to its maximum value.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Max(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("number", "max", target, data);
|
|
}
|
|
|
|
///<summary>Set a number entity to its minimum value.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Min(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("number", "min", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetValue(ServiceTarget target, NumberSetValueParameters data)
|
|
{
|
|
_haContext.CallService("number", "set_value", target, data);
|
|
}
|
|
|
|
///<param name="value"> eg: 42</param>
|
|
public void SetValue(ServiceTarget target, string value)
|
|
{
|
|
_haContext.CallService("number", "set_value", target, new NumberSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public partial record NumberDecrementParameters
|
|
{
|
|
///<summary>The amount to decrease the number with. If not provided, the step of the number entity will be used.</summary>
|
|
[JsonPropertyName("amount")]
|
|
public long? Amount { get; init; }
|
|
}
|
|
|
|
public partial record NumberIncrementParameters
|
|
{
|
|
///<summary>The amount to increase the number with. If not provided, the step of the number entity will be used.</summary>
|
|
[JsonPropertyName("amount")]
|
|
public long? Amount { get; init; }
|
|
}
|
|
|
|
public partial record NumberSetValueParameters
|
|
{
|
|
///<summary> eg: 42</summary>
|
|
[JsonPropertyName("value")]
|
|
public string? Value { get; init; }
|
|
}
|
|
|
|
public partial class PersistentNotificationServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public PersistentNotificationServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Create(PersistentNotificationCreateParameters data)
|
|
{
|
|
_haContext.CallService("persistent_notification", "create", null, data);
|
|
}
|
|
|
|
///<param name="message"> eg: Please check your configuration.yaml.</param>
|
|
///<param name="title"> eg: Test notification</param>
|
|
///<param name="notificationId"> eg: 1234</param>
|
|
public void Create(string message, string? title = null, string? notificationId = null)
|
|
{
|
|
_haContext.CallService("persistent_notification", "create", null, new PersistentNotificationCreateParameters { Message = message, Title = title, NotificationId = notificationId });
|
|
}
|
|
|
|
public void Dismiss(PersistentNotificationDismissParameters data)
|
|
{
|
|
_haContext.CallService("persistent_notification", "dismiss", null, data);
|
|
}
|
|
|
|
///<param name="notificationId"> eg: 1234</param>
|
|
public void Dismiss(string notificationId)
|
|
{
|
|
_haContext.CallService("persistent_notification", "dismiss", null, new PersistentNotificationDismissParameters { NotificationId = notificationId });
|
|
}
|
|
|
|
public void DismissAll(object? data = null)
|
|
{
|
|
_haContext.CallService("persistent_notification", "dismiss_all", null, data);
|
|
}
|
|
}
|
|
|
|
public partial record PersistentNotificationCreateParameters
|
|
{
|
|
///<summary> eg: Please check your configuration.yaml.</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
///<summary> eg: Test notification</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("notification_id")]
|
|
public string? NotificationId { get; init; }
|
|
}
|
|
|
|
public partial record PersistentNotificationDismissParameters
|
|
{
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("notification_id")]
|
|
public string? NotificationId { get; init; }
|
|
}
|
|
|
|
public partial class PersonServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public PersonServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Add a device tracker to a person.</summary>
|
|
public void AddDeviceTracker(PersonAddDeviceTrackerParameters data)
|
|
{
|
|
_haContext.CallService("person", "add_device_tracker", null, data);
|
|
}
|
|
|
|
///<summary>Add a device tracker to a person.</summary>
|
|
///<param name="entityId">The person entity ID to add the device tracker to.</param>
|
|
///<param name="deviceTracker">The device tracker entity ID to add to the person.</param>
|
|
public void AddDeviceTracker(string entityId, IEnumerable<string> deviceTracker)
|
|
{
|
|
_haContext.CallService("person", "add_device_tracker", null, new PersonAddDeviceTrackerParameters { EntityId = entityId, DeviceTracker = deviceTracker });
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("person", "reload", null, data);
|
|
}
|
|
|
|
///<summary>Remove a device tracker from a person.</summary>
|
|
public void RemoveDeviceTracker(PersonRemoveDeviceTrackerParameters data)
|
|
{
|
|
_haContext.CallService("person", "remove_device_tracker", null, data);
|
|
}
|
|
|
|
///<summary>Remove a device tracker from a person.</summary>
|
|
///<param name="entityId">The person entity ID to remove the device tracker from.</param>
|
|
///<param name="deviceTracker">The device tracker entity ID to remove from the person.</param>
|
|
public void RemoveDeviceTracker(string entityId, IEnumerable<string> deviceTracker)
|
|
{
|
|
_haContext.CallService("person", "remove_device_tracker", null, new PersonRemoveDeviceTrackerParameters { EntityId = entityId, DeviceTracker = deviceTracker });
|
|
}
|
|
}
|
|
|
|
public partial record PersonAddDeviceTrackerParameters
|
|
{
|
|
///<summary>The person entity ID to add the device tracker to.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
|
|
///<summary>The device tracker entity ID to add to the person.</summary>
|
|
[JsonPropertyName("device_tracker")]
|
|
public IEnumerable<string>? DeviceTracker { get; init; }
|
|
}
|
|
|
|
public partial record PersonRemoveDeviceTrackerParameters
|
|
{
|
|
///<summary>The person entity ID to remove the device tracker from.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
|
|
///<summary>The device tracker entity ID to remove from the person.</summary>
|
|
[JsonPropertyName("device_tracker")]
|
|
public IEnumerable<string>? DeviceTracker { get; init; }
|
|
}
|
|
|
|
public partial class RecorderServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public RecorderServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Disable(object? data = null)
|
|
{
|
|
_haContext.CallService("recorder", "disable", null, data);
|
|
}
|
|
|
|
public void Enable(object? data = null)
|
|
{
|
|
_haContext.CallService("recorder", "enable", null, data);
|
|
}
|
|
|
|
public void GetStatistics(RecorderGetStatisticsParameters data)
|
|
{
|
|
_haContext.CallService("recorder", "get_statistics", null, data);
|
|
}
|
|
|
|
///<param name="startTime"> eg: 2025-01-01 00:00:00</param>
|
|
///<param name="endTime"> eg: 2025-01-02 00:00:00</param>
|
|
///<param name="statisticIds"> eg: ["sensor.energy_consumption","sensor.temperature"]</param>
|
|
///<param name="period"> eg: hour</param>
|
|
///<param name="types"> eg: ["mean","sum"]</param>
|
|
///<param name="units"> eg: {"energy":"kWh","temperature":"°C"}</param>
|
|
public void GetStatistics(DateTime startTime, IEnumerable<object> statisticIds, object period, IEnumerable<object> types, DateTime? endTime = null, object? units = null)
|
|
{
|
|
_haContext.CallService("recorder", "get_statistics", null, new RecorderGetStatisticsParameters { StartTime = startTime, EndTime = endTime, StatisticIds = statisticIds, Period = period, Types = types, Units = units });
|
|
}
|
|
|
|
public Task<JsonElement?> GetStatisticsAsync(RecorderGetStatisticsParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("recorder", "get_statistics", null, data);
|
|
}
|
|
|
|
///<param name="startTime"> eg: 2025-01-01 00:00:00</param>
|
|
///<param name="endTime"> eg: 2025-01-02 00:00:00</param>
|
|
///<param name="statisticIds"> eg: ["sensor.energy_consumption","sensor.temperature"]</param>
|
|
///<param name="period"> eg: hour</param>
|
|
///<param name="types"> eg: ["mean","sum"]</param>
|
|
///<param name="units"> eg: {"energy":"kWh","temperature":"°C"}</param>
|
|
public Task<JsonElement?> GetStatisticsAsync(DateTime startTime, IEnumerable<object> statisticIds, object period, IEnumerable<object> types, DateTime? endTime = null, object? units = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("recorder", "get_statistics", null, new RecorderGetStatisticsParameters { StartTime = startTime, EndTime = endTime, StatisticIds = statisticIds, Period = period, Types = types, Units = units });
|
|
}
|
|
|
|
///<summary>Import long-term statistics.</summary>
|
|
public void ImportStatistics(RecorderImportStatisticsParameters data)
|
|
{
|
|
_haContext.CallService("recorder", "import_statistics", null, data);
|
|
}
|
|
|
|
///<summary>Import long-term statistics.</summary>
|
|
///<param name="statisticId">The statistics ID (entity ID) to import for.</param>
|
|
///<param name="name">The name of the statistics.</param>
|
|
///<param name="source">The source of the statistics data.</param>
|
|
///<param name="unitOfMeasurement">The unit of measurement of the statistics.</param>
|
|
///<param name="hasMean">If the statistics has a mean value.</param>
|
|
///<param name="hasSum">If the statistics has a sum value.</param>
|
|
///<param name="stats">A list of mappings/dictionaries with statistics to import. The dictionaries must contain a "start" key with a datetime string other valid options are "mean", "sum", "min", "max", "last_reset", and "state". All of those are optional and either an integer or a float, except for "last_reset" which is a datetime string.</param>
|
|
public void ImportStatistics(string statisticId, string source, bool hasMean, bool hasSum, object stats, string? name = null, string? unitOfMeasurement = null)
|
|
{
|
|
_haContext.CallService("recorder", "import_statistics", null, new RecorderImportStatisticsParameters { StatisticId = statisticId, Name = name, Source = source, UnitOfMeasurement = unitOfMeasurement, HasMean = hasMean, HasSum = hasSum, Stats = stats });
|
|
}
|
|
|
|
public void Purge(RecorderPurgeParameters data)
|
|
{
|
|
_haContext.CallService("recorder", "purge", null, data);
|
|
}
|
|
|
|
///<param name="keepDays"></param>
|
|
///<param name="repack"></param>
|
|
///<param name="applyFilter"></param>
|
|
public void Purge(long? keepDays = null, bool? repack = null, bool? applyFilter = null)
|
|
{
|
|
_haContext.CallService("recorder", "purge", null, new RecorderPurgeParameters { KeepDays = keepDays, Repack = repack, ApplyFilter = applyFilter });
|
|
}
|
|
|
|
public void PurgeEntities(RecorderPurgeEntitiesParameters data)
|
|
{
|
|
_haContext.CallService("recorder", "purge_entities", null, data);
|
|
}
|
|
|
|
///<param name="entityId"></param>
|
|
///<param name="domains"> eg: sun</param>
|
|
///<param name="entityGlobs"> eg: domain*.object_id*</param>
|
|
///<param name="keepDays"></param>
|
|
public void PurgeEntities(IEnumerable<string>? entityId = null, object? domains = null, object? entityGlobs = null, long? keepDays = null)
|
|
{
|
|
_haContext.CallService("recorder", "purge_entities", null, new RecorderPurgeEntitiesParameters { EntityId = entityId, Domains = domains, EntityGlobs = entityGlobs, KeepDays = keepDays });
|
|
}
|
|
}
|
|
|
|
public partial record RecorderGetStatisticsParameters
|
|
{
|
|
///<summary> eg: 2025-01-01 00:00:00</summary>
|
|
[JsonPropertyName("start_time")]
|
|
public DateTime? StartTime { get; init; }
|
|
|
|
///<summary> eg: 2025-01-02 00:00:00</summary>
|
|
[JsonPropertyName("end_time")]
|
|
public DateTime? EndTime { get; init; }
|
|
|
|
///<summary> eg: ["sensor.energy_consumption","sensor.temperature"]</summary>
|
|
[JsonPropertyName("statistic_ids")]
|
|
public IEnumerable<object>? StatisticIds { get; init; }
|
|
|
|
///<summary> eg: hour</summary>
|
|
[JsonPropertyName("period")]
|
|
public object? Period { get; init; }
|
|
|
|
///<summary> eg: ["mean","sum"]</summary>
|
|
[JsonPropertyName("types")]
|
|
public IEnumerable<object>? Types { get; init; }
|
|
|
|
///<summary> eg: {"energy":"kWh","temperature":"°C"}</summary>
|
|
[JsonPropertyName("units")]
|
|
public object? Units { get; init; }
|
|
}
|
|
|
|
public partial record RecorderImportStatisticsParameters
|
|
{
|
|
///<summary>The statistics ID (entity ID) to import for.</summary>
|
|
[JsonPropertyName("statistic_id")]
|
|
public string? StatisticId { get; init; }
|
|
|
|
///<summary>The name of the statistics.</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary>The source of the statistics data.</summary>
|
|
[JsonPropertyName("source")]
|
|
public string? Source { get; init; }
|
|
|
|
///<summary>The unit of measurement of the statistics.</summary>
|
|
[JsonPropertyName("unit_of_measurement")]
|
|
public string? UnitOfMeasurement { get; init; }
|
|
|
|
///<summary>If the statistics has a mean value.</summary>
|
|
[JsonPropertyName("has_mean")]
|
|
public bool? HasMean { get; init; }
|
|
|
|
///<summary>If the statistics has a sum value.</summary>
|
|
[JsonPropertyName("has_sum")]
|
|
public bool? HasSum { get; init; }
|
|
|
|
///<summary>A list of mappings/dictionaries with statistics to import. The dictionaries must contain a "start" key with a datetime string other valid options are "mean", "sum", "min", "max", "last_reset", and "state". All of those are optional and either an integer or a float, except for "last_reset" which is a datetime string.</summary>
|
|
[JsonPropertyName("stats")]
|
|
public object? Stats { get; init; }
|
|
}
|
|
|
|
public partial record RecorderPurgeParameters
|
|
{
|
|
[JsonPropertyName("keep_days")]
|
|
public long? KeepDays { get; init; }
|
|
|
|
[JsonPropertyName("repack")]
|
|
public bool? Repack { get; init; }
|
|
|
|
[JsonPropertyName("apply_filter")]
|
|
public bool? ApplyFilter { get; init; }
|
|
}
|
|
|
|
public partial record RecorderPurgeEntitiesParameters
|
|
{
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
|
|
///<summary> eg: sun</summary>
|
|
[JsonPropertyName("domains")]
|
|
public object? Domains { get; init; }
|
|
|
|
///<summary> eg: domain*.object_id*</summary>
|
|
[JsonPropertyName("entity_globs")]
|
|
public object? EntityGlobs { get; init; }
|
|
|
|
[JsonPropertyName("keep_days")]
|
|
public long? KeepDays { get; init; }
|
|
}
|
|
|
|
public partial class RemoteServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public RemoteServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void DeleteCommand(ServiceTarget target, RemoteDeleteCommandParameters data)
|
|
{
|
|
_haContext.CallService("remote", "delete_command", target, data);
|
|
}
|
|
|
|
///<param name="device"> eg: television</param>
|
|
///<param name="command"> eg: Mute</param>
|
|
public void DeleteCommand(ServiceTarget target, object command, string? device = null)
|
|
{
|
|
_haContext.CallService("remote", "delete_command", target, new RemoteDeleteCommandParameters { Device = device, Command = command });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void LearnCommand(ServiceTarget target, RemoteLearnCommandParameters data)
|
|
{
|
|
_haContext.CallService("remote", "learn_command", target, data);
|
|
}
|
|
|
|
///<param name="device"> eg: television</param>
|
|
///<param name="command"> eg: Turn on</param>
|
|
///<param name="commandType"></param>
|
|
///<param name="alternative"></param>
|
|
///<param name="timeout"></param>
|
|
public void LearnCommand(ServiceTarget target, string? device = null, object? command = null, object? commandType = null, bool? alternative = null, long? timeout = null)
|
|
{
|
|
_haContext.CallService("remote", "learn_command", target, new RemoteLearnCommandParameters { Device = device, Command = command, CommandType = commandType, Alternative = alternative, Timeout = timeout });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SendCommand(ServiceTarget target, RemoteSendCommandParameters data)
|
|
{
|
|
_haContext.CallService("remote", "send_command", target, data);
|
|
}
|
|
|
|
///<param name="device"> eg: 32756745</param>
|
|
///<param name="command"> eg: Play</param>
|
|
///<param name="numRepeats"></param>
|
|
///<param name="delaySecs"></param>
|
|
///<param name="holdSecs"></param>
|
|
public void SendCommand(ServiceTarget target, object command, string? device = null, long? numRepeats = null, double? delaySecs = null, double? holdSecs = null)
|
|
{
|
|
_haContext.CallService("remote", "send_command", target, new RemoteSendCommandParameters { Device = device, Command = command, NumRepeats = numRepeats, DelaySecs = delaySecs, HoldSecs = holdSecs });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("remote", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("remote", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, RemoteTurnOnParameters data)
|
|
{
|
|
_haContext.CallService("remote", "turn_on", target, data);
|
|
}
|
|
|
|
///<param name="activity"> eg: BedroomTV</param>
|
|
public void TurnOn(ServiceTarget target, string? activity = null)
|
|
{
|
|
_haContext.CallService("remote", "turn_on", target, new RemoteTurnOnParameters { Activity = activity });
|
|
}
|
|
}
|
|
|
|
public partial record RemoteDeleteCommandParameters
|
|
{
|
|
///<summary> eg: television</summary>
|
|
[JsonPropertyName("device")]
|
|
public string? Device { get; init; }
|
|
|
|
///<summary> eg: Mute</summary>
|
|
[JsonPropertyName("command")]
|
|
public object? Command { get; init; }
|
|
}
|
|
|
|
public partial record RemoteLearnCommandParameters
|
|
{
|
|
///<summary> eg: television</summary>
|
|
[JsonPropertyName("device")]
|
|
public string? Device { get; init; }
|
|
|
|
///<summary> eg: Turn on</summary>
|
|
[JsonPropertyName("command")]
|
|
public object? Command { get; init; }
|
|
|
|
[JsonPropertyName("command_type")]
|
|
public object? CommandType { get; init; }
|
|
|
|
[JsonPropertyName("alternative")]
|
|
public bool? Alternative { get; init; }
|
|
|
|
[JsonPropertyName("timeout")]
|
|
public long? Timeout { get; init; }
|
|
}
|
|
|
|
public partial record RemoteSendCommandParameters
|
|
{
|
|
///<summary> eg: 32756745</summary>
|
|
[JsonPropertyName("device")]
|
|
public string? Device { get; init; }
|
|
|
|
///<summary> eg: Play</summary>
|
|
[JsonPropertyName("command")]
|
|
public object? Command { get; init; }
|
|
|
|
[JsonPropertyName("num_repeats")]
|
|
public long? NumRepeats { get; init; }
|
|
|
|
[JsonPropertyName("delay_secs")]
|
|
public double? DelaySecs { get; init; }
|
|
|
|
[JsonPropertyName("hold_secs")]
|
|
public double? HoldSecs { get; init; }
|
|
}
|
|
|
|
public partial record RemoteTurnOnParameters
|
|
{
|
|
///<summary> eg: BedroomTV</summary>
|
|
[JsonPropertyName("activity")]
|
|
public string? Activity { get; init; }
|
|
}
|
|
|
|
public partial class RepairsServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public RepairsServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Manually create and raise a issue in Home Assistant repairs.</summary>
|
|
public void Create(RepairsCreateParameters data)
|
|
{
|
|
_haContext.CallService("repairs", "create", null, data);
|
|
}
|
|
|
|
///<summary>Manually create and raise a issue in Home Assistant repairs.</summary>
|
|
///<param name="title">The title of the issue.</param>
|
|
///<param name="description">The description of the issue. Supports Markdown.</param>
|
|
///<param name="issueId">The issue can have an identifier, which allows you to cancel it later with that ID if needed. It also prevent duplicate issues to be created. If not provided, a random ID will be generated.</param>
|
|
///<param name="domain">This field can be used to set the domain of the issue. For example, by default (if not set), it will use "spook". This causes Spook to be shown in the logo/image of the issue. If you set it to "homeassistant", the Home Assistant logo will be used, or use "hue", "zwave_js", "mqtt", etc. to use the logo of that integration.</param>
|
|
///<param name="severity">The severity of the issue. This will be used to determine the priority of the issue. If not set, "warning" will be used</param>
|
|
///<param name="persistent">If the issue should be persistent, which means it will survive restarts of Home Assistant. By default, issues are not persistent.</param>
|
|
public void Create(string title, string description, string? issueId = null, string? domain = null, object? severity = null, bool? persistent = null)
|
|
{
|
|
_haContext.CallService("repairs", "create", null, new RepairsCreateParameters { Title = title, Description = description, IssueId = issueId, Domain = domain, Severity = severity, Persistent = persistent });
|
|
}
|
|
|
|
///<summary>Ignore all issues currently raised in Home Assistant Repairs.</summary>
|
|
public void IgnoreAll(object? data = null)
|
|
{
|
|
_haContext.CallService("repairs", "ignore_all", null, data);
|
|
}
|
|
|
|
///<summary>Removes a manually created Home Assistant repairs issue. This action can only remove issues created with the `repairs_create` action.</summary>
|
|
public void Remove(RepairsRemoveParameters data)
|
|
{
|
|
_haContext.CallService("repairs", "remove", null, data);
|
|
}
|
|
|
|
///<summary>Removes a manually created Home Assistant repairs issue. This action can only remove issues created with the `repairs_create` action.</summary>
|
|
///<param name="issueId">The issue ID to remove.</param>
|
|
public void Remove(string issueId)
|
|
{
|
|
_haContext.CallService("repairs", "remove", null, new RepairsRemoveParameters { IssueId = issueId });
|
|
}
|
|
|
|
///<summary>Unignore all issues currently raised in Home Assistant Repairs.</summary>
|
|
public void UnignoreAll(object? data = null)
|
|
{
|
|
_haContext.CallService("repairs", "unignore_all", null, data);
|
|
}
|
|
}
|
|
|
|
public partial record RepairsCreateParameters
|
|
{
|
|
///<summary>The title of the issue.</summary>
|
|
[JsonPropertyName("title")]
|
|
public string? Title { get; init; }
|
|
|
|
///<summary>The description of the issue. Supports Markdown.</summary>
|
|
[JsonPropertyName("description")]
|
|
public string? Description { get; init; }
|
|
|
|
///<summary>The issue can have an identifier, which allows you to cancel it later with that ID if needed. It also prevent duplicate issues to be created. If not provided, a random ID will be generated.</summary>
|
|
[JsonPropertyName("issue_id")]
|
|
public string? IssueId { get; init; }
|
|
|
|
///<summary>This field can be used to set the domain of the issue. For example, by default (if not set), it will use "spook". This causes Spook to be shown in the logo/image of the issue. If you set it to "homeassistant", the Home Assistant logo will be used, or use "hue", "zwave_js", "mqtt", etc. to use the logo of that integration.</summary>
|
|
[JsonPropertyName("domain")]
|
|
public string? Domain { get; init; }
|
|
|
|
///<summary>The severity of the issue. This will be used to determine the priority of the issue. If not set, "warning" will be used</summary>
|
|
[JsonPropertyName("severity")]
|
|
public object? Severity { get; init; }
|
|
|
|
///<summary>If the issue should be persistent, which means it will survive restarts of Home Assistant. By default, issues are not persistent.</summary>
|
|
[JsonPropertyName("persistent")]
|
|
public bool? Persistent { get; init; }
|
|
}
|
|
|
|
public partial record RepairsRemoveParameters
|
|
{
|
|
///<summary>The issue ID to remove.</summary>
|
|
[JsonPropertyName("issue_id")]
|
|
public string? IssueId { get; init; }
|
|
}
|
|
|
|
public partial class SceneServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SceneServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Apply(SceneApplyParameters data)
|
|
{
|
|
_haContext.CallService("scene", "apply", null, data);
|
|
}
|
|
|
|
///<param name="entities"> eg: light.kitchen: "on" light.ceiling: state: "on" brightness: 80 </param>
|
|
///<param name="transition"></param>
|
|
public void Apply(object entities, long? transition = null)
|
|
{
|
|
_haContext.CallService("scene", "apply", null, new SceneApplyParameters { Entities = entities, Transition = transition });
|
|
}
|
|
|
|
public void Create(SceneCreateParameters data)
|
|
{
|
|
_haContext.CallService("scene", "create", null, data);
|
|
}
|
|
|
|
///<param name="sceneId"> eg: all_lights</param>
|
|
///<param name="entities"> eg: light.tv_back_light: "on" light.ceiling: state: "on" brightness: 200 </param>
|
|
///<param name="snapshotEntities"> eg: - light.ceiling - light.kitchen </param>
|
|
public void Create(string sceneId, object? entities = null, IEnumerable<string>? snapshotEntities = null)
|
|
{
|
|
_haContext.CallService("scene", "create", null, new SceneCreateParameters { SceneId = sceneId, Entities = entities, SnapshotEntities = snapshotEntities });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Delete(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("scene", "delete", target, data);
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("scene", "reload", null, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, SceneTurnOnParameters data)
|
|
{
|
|
_haContext.CallService("scene", "turn_on", target, data);
|
|
}
|
|
|
|
///<param name="transition"></param>
|
|
public void TurnOn(ServiceTarget target, long? transition = null)
|
|
{
|
|
_haContext.CallService("scene", "turn_on", target, new SceneTurnOnParameters { Transition = transition });
|
|
}
|
|
}
|
|
|
|
public partial record SceneApplyParameters
|
|
{
|
|
///<summary> eg: light.kitchen: "on" light.ceiling: state: "on" brightness: 80 </summary>
|
|
[JsonPropertyName("entities")]
|
|
public object? Entities { get; init; }
|
|
|
|
[JsonPropertyName("transition")]
|
|
public long? Transition { get; init; }
|
|
}
|
|
|
|
public partial record SceneCreateParameters
|
|
{
|
|
///<summary> eg: all_lights</summary>
|
|
[JsonPropertyName("scene_id")]
|
|
public string? SceneId { get; init; }
|
|
|
|
///<summary> eg: light.tv_back_light: "on" light.ceiling: state: "on" brightness: 200 </summary>
|
|
[JsonPropertyName("entities")]
|
|
public object? Entities { get; init; }
|
|
|
|
///<summary> eg: - light.ceiling - light.kitchen </summary>
|
|
[JsonPropertyName("snapshot_entities")]
|
|
public IEnumerable<string>? SnapshotEntities { get; init; }
|
|
}
|
|
|
|
public partial record SceneTurnOnParameters
|
|
{
|
|
[JsonPropertyName("transition")]
|
|
public long? Transition { get; init; }
|
|
}
|
|
|
|
public partial class ScheduleServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ScheduleServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void GetSchedule(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("schedule", "get_schedule", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public Task<JsonElement?> GetScheduleAsync(ServiceTarget target, object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("schedule", "get_schedule", target, data);
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("schedule", "reload", null, data);
|
|
}
|
|
}
|
|
|
|
public partial class ScriptServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ScriptServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("script", "reload", null, data);
|
|
}
|
|
|
|
public void SystemPurgeDeviceHistory(ScriptSystemPurgeDeviceHistoryParameters data)
|
|
{
|
|
_haContext.CallService("script", "system_purge_device_history", null, data);
|
|
}
|
|
|
|
///<param name="deviceId">The device to purge all history from.</param>
|
|
public void SystemPurgeDeviceHistory(IEnumerable<string> deviceId)
|
|
{
|
|
_haContext.CallService("script", "system_purge_device_history", null, new ScriptSystemPurgeDeviceHistoryParameters { DeviceId = deviceId });
|
|
}
|
|
|
|
public Task<JsonElement?> SystemPurgeDeviceHistoryAsync(ScriptSystemPurgeDeviceHistoryParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("script", "system_purge_device_history", null, data);
|
|
}
|
|
|
|
///<param name="deviceId">The device to purge all history from.</param>
|
|
public Task<JsonElement?> SystemPurgeDeviceHistoryAsync(IEnumerable<string> deviceId)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("script", "system_purge_device_history", null, new ScriptSystemPurgeDeviceHistoryParameters { DeviceId = deviceId });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("script", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("script", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("script", "turn_on", target, data);
|
|
}
|
|
|
|
public void Updatenordpoolprices(object? data = null)
|
|
{
|
|
_haContext.CallService("script", "updatenordpoolprices", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> UpdatenordpoolpricesAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("script", "updatenordpoolprices", null, data);
|
|
}
|
|
}
|
|
|
|
public partial record ScriptSystemPurgeDeviceHistoryParameters
|
|
{
|
|
///<summary>The device to purge all history from.</summary>
|
|
[JsonPropertyName("device_id")]
|
|
public IEnumerable<string>? DeviceId { get; init; }
|
|
}
|
|
|
|
public partial class SelectServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SelectServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Select an random option for a select entity.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void Random(ServiceTarget target, SelectRandomParameters data)
|
|
{
|
|
_haContext.CallService("select", "random", target, data);
|
|
}
|
|
|
|
///<summary>Select an random option for a select entity.</summary>
|
|
///<param name="options">Limits the options to select from. If not provided, all options will be considered.</param>
|
|
public void Random(ServiceTarget target, object? options = null)
|
|
{
|
|
_haContext.CallService("select", "random", target, new SelectRandomParameters { Options = options });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectFirst(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("select", "select_first", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectLast(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("select", "select_last", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectNext(ServiceTarget target, SelectSelectNextParameters data)
|
|
{
|
|
_haContext.CallService("select", "select_next", target, data);
|
|
}
|
|
|
|
///<param name="cycle"></param>
|
|
public void SelectNext(ServiceTarget target, bool? cycle = null)
|
|
{
|
|
_haContext.CallService("select", "select_next", target, new SelectSelectNextParameters { Cycle = cycle });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectOption(ServiceTarget target, SelectSelectOptionParameters data)
|
|
{
|
|
_haContext.CallService("select", "select_option", target, data);
|
|
}
|
|
|
|
///<param name="option"> eg: "Item A"</param>
|
|
public void SelectOption(ServiceTarget target, object option)
|
|
{
|
|
_haContext.CallService("select", "select_option", target, new SelectSelectOptionParameters { Option = option });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SelectPrevious(ServiceTarget target, SelectSelectPreviousParameters data)
|
|
{
|
|
_haContext.CallService("select", "select_previous", target, data);
|
|
}
|
|
|
|
///<param name="cycle"></param>
|
|
public void SelectPrevious(ServiceTarget target, bool? cycle = null)
|
|
{
|
|
_haContext.CallService("select", "select_previous", target, new SelectSelectPreviousParameters { Cycle = cycle });
|
|
}
|
|
}
|
|
|
|
public partial record SelectRandomParameters
|
|
{
|
|
///<summary>Limits the options to select from. If not provided, all options will be considered.</summary>
|
|
[JsonPropertyName("options")]
|
|
public object? Options { get; init; }
|
|
}
|
|
|
|
public partial record SelectSelectNextParameters
|
|
{
|
|
[JsonPropertyName("cycle")]
|
|
public bool? Cycle { get; init; }
|
|
}
|
|
|
|
public partial record SelectSelectOptionParameters
|
|
{
|
|
///<summary> eg: "Item A"</summary>
|
|
[JsonPropertyName("option")]
|
|
public object? Option { get; init; }
|
|
}
|
|
|
|
public partial record SelectSelectPreviousParameters
|
|
{
|
|
[JsonPropertyName("cycle")]
|
|
public bool? Cycle { get; init; }
|
|
}
|
|
|
|
public partial class SirenServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SirenServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("siren", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("siren", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, SirenTurnOnParameters data)
|
|
{
|
|
_haContext.CallService("siren", "turn_on", target, data);
|
|
}
|
|
|
|
///<param name="tone"> eg: fire</param>
|
|
///<param name="volumeLevel"> eg: 0.5</param>
|
|
///<param name="duration"> eg: 15</param>
|
|
public void TurnOn(ServiceTarget target, string? tone = null, double? volumeLevel = null, string? duration = null)
|
|
{
|
|
_haContext.CallService("siren", "turn_on", target, new SirenTurnOnParameters { Tone = tone, VolumeLevel = volumeLevel, Duration = duration });
|
|
}
|
|
}
|
|
|
|
public partial record SirenTurnOnParameters
|
|
{
|
|
///<summary> eg: fire</summary>
|
|
[JsonPropertyName("tone")]
|
|
public string? Tone { get; init; }
|
|
|
|
///<summary> eg: 0.5</summary>
|
|
[JsonPropertyName("volume_level")]
|
|
public double? VolumeLevel { get; init; }
|
|
|
|
///<summary> eg: 15</summary>
|
|
[JsonPropertyName("duration")]
|
|
public string? Duration { get; init; }
|
|
}
|
|
|
|
public partial class SystemLogServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SystemLogServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Clear(object? data = null)
|
|
{
|
|
_haContext.CallService("system_log", "clear", null, data);
|
|
}
|
|
|
|
public void Write(SystemLogWriteParameters data)
|
|
{
|
|
_haContext.CallService("system_log", "write", null, data);
|
|
}
|
|
|
|
///<param name="message"> eg: Something went wrong</param>
|
|
///<param name="level"></param>
|
|
///<param name="logger"> eg: mycomponent.myplatform</param>
|
|
public void Write(string message, object? level = null, string? logger = null)
|
|
{
|
|
_haContext.CallService("system_log", "write", null, new SystemLogWriteParameters { Message = message, Level = level, Logger = logger });
|
|
}
|
|
}
|
|
|
|
public partial record SystemLogWriteParameters
|
|
{
|
|
///<summary> eg: Something went wrong</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
[JsonPropertyName("level")]
|
|
public object? Level { get; init; }
|
|
|
|
///<summary> eg: mycomponent.myplatform</summary>
|
|
[JsonPropertyName("logger")]
|
|
public string? Logger { get; init; }
|
|
}
|
|
|
|
public partial class SonoffServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SonoffServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Sends a command to a device.</summary>
|
|
public void SendCommand(SonoffSendCommandParameters data)
|
|
{
|
|
_haContext.CallService("sonoff", "send_command", null, data);
|
|
}
|
|
|
|
///<summary>Sends a command to a device.</summary>
|
|
///<param name="device">Device ID to send command to. eg: 1000123456</param>
|
|
///<param name="cmd">A single command to send. eg: switch</param>
|
|
public void SendCommand(object? device = null, object? cmd = null)
|
|
{
|
|
_haContext.CallService("sonoff", "send_command", null, new SonoffSendCommandParameters { Device = device, Cmd = cmd });
|
|
}
|
|
}
|
|
|
|
public partial record SonoffSendCommandParameters
|
|
{
|
|
///<summary>Device ID to send command to. eg: 1000123456</summary>
|
|
[JsonPropertyName("device")]
|
|
public object? Device { get; init; }
|
|
|
|
///<summary>A single command to send. eg: switch</summary>
|
|
[JsonPropertyName("cmd")]
|
|
public object? Cmd { get; init; }
|
|
}
|
|
|
|
public partial class SpookServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SpookServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Calling this action spooks Home Assistant. Performing this action will always fail.</summary>
|
|
public void Boo(object? data = null)
|
|
{
|
|
_haContext.CallService("spook", "boo", null, data);
|
|
}
|
|
|
|
///<summary>Performing this action will randomly fail.</summary>
|
|
public void RandomFail(object? data = null)
|
|
{
|
|
_haContext.CallService("spook", "random_fail", null, data);
|
|
}
|
|
}
|
|
|
|
public partial class SwitchServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public SwitchServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("switch", "toggle", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOff(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("switch", "turn_off", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void TurnOn(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("switch", "turn_on", target, data);
|
|
}
|
|
}
|
|
|
|
public partial class TemplateServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public TemplateServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("template", "reload", null, data);
|
|
}
|
|
}
|
|
|
|
public partial class TextServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public TextServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetValue(ServiceTarget target, TextSetValueParameters data)
|
|
{
|
|
_haContext.CallService("text", "set_value", target, data);
|
|
}
|
|
|
|
///<param name="value"> eg: Hello world!</param>
|
|
public void SetValue(ServiceTarget target, string value)
|
|
{
|
|
_haContext.CallService("text", "set_value", target, new TextSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public partial record TextSetValueParameters
|
|
{
|
|
///<summary> eg: Hello world!</summary>
|
|
[JsonPropertyName("value")]
|
|
public string? Value { get; init; }
|
|
}
|
|
|
|
public partial class TimeServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public TimeServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetValue(ServiceTarget target, TimeSetValueParameters data)
|
|
{
|
|
_haContext.CallService("time", "set_value", target, data);
|
|
}
|
|
|
|
///<param name="time"> eg: 22:15</param>
|
|
public void SetValue(ServiceTarget target, TimeOnly time)
|
|
{
|
|
_haContext.CallService("time", "set_value", target, new TimeSetValueParameters { Time = time });
|
|
}
|
|
}
|
|
|
|
public partial record TimeSetValueParameters
|
|
{
|
|
///<summary> eg: 22:15</summary>
|
|
[JsonPropertyName("time")]
|
|
public TimeOnly? Time { get; init; }
|
|
}
|
|
|
|
public partial class TimerServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public TimerServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Cancel(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("timer", "cancel", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Change(ServiceTarget target, TimerChangeParameters data)
|
|
{
|
|
_haContext.CallService("timer", "change", target, data);
|
|
}
|
|
|
|
///<param name="duration"> eg: 00:01:00, 60 or -60</param>
|
|
public void Change(ServiceTarget target, object duration)
|
|
{
|
|
_haContext.CallService("timer", "change", target, new TimerChangeParameters { Duration = duration });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Finish(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("timer", "finish", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Pause(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("timer", "pause", target, data);
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("timer", "reload", null, data);
|
|
}
|
|
|
|
///<summary>Set duration for an existing timer.</summary>
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetDuration(ServiceTarget target, TimerSetDurationParameters data)
|
|
{
|
|
_haContext.CallService("timer", "set_duration", target, data);
|
|
}
|
|
|
|
///<summary>Set duration for an existing timer.</summary>
|
|
///<param name="duration">New duration for the timer, as a timedelta string. eg: 00:01:00, 60</param>
|
|
public void SetDuration(ServiceTarget target, string duration)
|
|
{
|
|
_haContext.CallService("timer", "set_duration", target, new TimerSetDurationParameters { Duration = duration });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Start(ServiceTarget target, TimerStartParameters data)
|
|
{
|
|
_haContext.CallService("timer", "start", target, data);
|
|
}
|
|
|
|
///<param name="duration"> eg: 00:01:00 or 60</param>
|
|
public void Start(ServiceTarget target, object? duration = null)
|
|
{
|
|
_haContext.CallService("timer", "start", target, new TimerStartParameters { Duration = duration });
|
|
}
|
|
}
|
|
|
|
public partial record TimerChangeParameters
|
|
{
|
|
///<summary> eg: 00:01:00, 60 or -60</summary>
|
|
[JsonPropertyName("duration")]
|
|
public object? Duration { get; init; }
|
|
}
|
|
|
|
public partial record TimerSetDurationParameters
|
|
{
|
|
///<summary>New duration for the timer, as a timedelta string. eg: 00:01:00, 60</summary>
|
|
[JsonPropertyName("duration")]
|
|
public string? Duration { get; init; }
|
|
}
|
|
|
|
public partial record TimerStartParameters
|
|
{
|
|
///<summary> eg: 00:01:00 or 60</summary>
|
|
[JsonPropertyName("duration")]
|
|
public object? Duration { get; init; }
|
|
}
|
|
|
|
public partial class TtsServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public TtsServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
public void ClearCache(object? data = null)
|
|
{
|
|
_haContext.CallService("tts", "clear_cache", null, data);
|
|
}
|
|
|
|
///<summary>Say something using text-to-speech on a media player with cloud.</summary>
|
|
public void CloudSay(TtsCloudSayParameters data)
|
|
{
|
|
_haContext.CallService("tts", "cloud_say", null, data);
|
|
}
|
|
|
|
///<summary>Say something using text-to-speech on a media player with cloud.</summary>
|
|
///<param name="entityId"></param>
|
|
///<param name="message"> eg: My name is hanna</param>
|
|
///<param name="cache"></param>
|
|
///<param name="language"> eg: ru</param>
|
|
///<param name="options"> eg: platform specific</param>
|
|
public void CloudSay(string entityId, string message, bool? cache = null, string? language = null, object? options = null)
|
|
{
|
|
_haContext.CallService("tts", "cloud_say", null, new TtsCloudSayParameters { EntityId = entityId, Message = message, Cache = cache, Language = language, Options = options });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Speak(ServiceTarget target, TtsSpeakParameters data)
|
|
{
|
|
_haContext.CallService("tts", "speak", target, data);
|
|
}
|
|
|
|
///<param name="mediaPlayerEntityId"></param>
|
|
///<param name="message"> eg: My name is hanna</param>
|
|
///<param name="cache"></param>
|
|
///<param name="language"> eg: ru</param>
|
|
///<param name="options"> eg: platform specific</param>
|
|
public void Speak(ServiceTarget target, string mediaPlayerEntityId, string message, bool? cache = null, string? language = null, object? options = null)
|
|
{
|
|
_haContext.CallService("tts", "speak", target, new TtsSpeakParameters { MediaPlayerEntityId = mediaPlayerEntityId, Message = message, Cache = cache, Language = language, Options = options });
|
|
}
|
|
}
|
|
|
|
public partial record TtsCloudSayParameters
|
|
{
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
|
|
///<summary> eg: My name is hanna</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
[JsonPropertyName("cache")]
|
|
public bool? Cache { get; init; }
|
|
|
|
///<summary> eg: ru</summary>
|
|
[JsonPropertyName("language")]
|
|
public string? Language { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("options")]
|
|
public object? Options { get; init; }
|
|
}
|
|
|
|
public partial record TtsSpeakParameters
|
|
{
|
|
[JsonPropertyName("media_player_entity_id")]
|
|
public string? MediaPlayerEntityId { get; init; }
|
|
|
|
///<summary> eg: My name is hanna</summary>
|
|
[JsonPropertyName("message")]
|
|
public string? Message { get; init; }
|
|
|
|
[JsonPropertyName("cache")]
|
|
public bool? Cache { get; init; }
|
|
|
|
///<summary> eg: ru</summary>
|
|
[JsonPropertyName("language")]
|
|
public string? Language { get; init; }
|
|
|
|
///<summary> eg: platform specific</summary>
|
|
[JsonPropertyName("options")]
|
|
public object? Options { get; init; }
|
|
}
|
|
|
|
public partial class UpdateServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public UpdateServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void ClearSkipped(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("update", "clear_skipped", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Install(ServiceTarget target, UpdateInstallParameters data)
|
|
{
|
|
_haContext.CallService("update", "install", target, data);
|
|
}
|
|
|
|
///<param name="version"> eg: 1.0.0</param>
|
|
///<param name="backup"></param>
|
|
public void Install(ServiceTarget target, string? version = null, bool? backup = null)
|
|
{
|
|
_haContext.CallService("update", "install", target, new UpdateInstallParameters { Version = version, Backup = backup });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Skip(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("update", "skip", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record UpdateInstallParameters
|
|
{
|
|
///<summary> eg: 1.0.0</summary>
|
|
[JsonPropertyName("version")]
|
|
public string? Version { get; init; }
|
|
|
|
[JsonPropertyName("backup")]
|
|
public bool? Backup { get; init; }
|
|
}
|
|
|
|
public partial class VacuumServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public VacuumServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void CleanArea(ServiceTarget target, VacuumCleanAreaParameters data)
|
|
{
|
|
_haContext.CallService("vacuum", "clean_area", target, data);
|
|
}
|
|
|
|
///<param name="cleaningAreaId"></param>
|
|
public void CleanArea(ServiceTarget target, IEnumerable<string> cleaningAreaId)
|
|
{
|
|
_haContext.CallService("vacuum", "clean_area", target, new VacuumCleanAreaParameters { CleaningAreaId = cleaningAreaId });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void CleanSpot(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("vacuum", "clean_spot", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Locate(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("vacuum", "locate", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Pause(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("vacuum", "pause", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void ReturnToBase(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("vacuum", "return_to_base", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SendCommand(ServiceTarget target, VacuumSendCommandParameters data)
|
|
{
|
|
_haContext.CallService("vacuum", "send_command", target, data);
|
|
}
|
|
|
|
///<param name="command"> eg: set_dnd_timer</param>
|
|
///<param name="params"> eg: { "key": "value" }</param>
|
|
public void SendCommand(ServiceTarget target, string command, object? @params = null)
|
|
{
|
|
_haContext.CallService("vacuum", "send_command", target, new VacuumSendCommandParameters { Command = command, Params = @params });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetFanSpeed(ServiceTarget target, VacuumSetFanSpeedParameters data)
|
|
{
|
|
_haContext.CallService("vacuum", "set_fan_speed", target, data);
|
|
}
|
|
|
|
///<param name="fanSpeed"> eg: low</param>
|
|
public void SetFanSpeed(ServiceTarget target, string fanSpeed)
|
|
{
|
|
_haContext.CallService("vacuum", "set_fan_speed", target, new VacuumSetFanSpeedParameters { FanSpeed = fanSpeed });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Start(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("vacuum", "start", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Stop(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("vacuum", "stop", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record VacuumCleanAreaParameters
|
|
{
|
|
[JsonPropertyName("cleaning_area_id")]
|
|
public IEnumerable<string>? CleaningAreaId { get; init; }
|
|
}
|
|
|
|
public partial record VacuumSendCommandParameters
|
|
{
|
|
///<summary> eg: set_dnd_timer</summary>
|
|
[JsonPropertyName("command")]
|
|
public string? Command { get; init; }
|
|
|
|
///<summary> eg: { "key": "value" }</summary>
|
|
[JsonPropertyName("params")]
|
|
public object? Params { get; init; }
|
|
}
|
|
|
|
public partial record VacuumSetFanSpeedParameters
|
|
{
|
|
///<summary> eg: low</summary>
|
|
[JsonPropertyName("fan_speed")]
|
|
public string? FanSpeed { get; init; }
|
|
}
|
|
|
|
public partial class ValveServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ValveServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void CloseValve(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("valve", "close_valve", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void OpenValve(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("valve", "open_valve", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetValvePosition(ServiceTarget target, ValveSetValvePositionParameters data)
|
|
{
|
|
_haContext.CallService("valve", "set_valve_position", target, data);
|
|
}
|
|
|
|
///<param name="position"></param>
|
|
public void SetValvePosition(ServiceTarget target, long position)
|
|
{
|
|
_haContext.CallService("valve", "set_valve_position", target, new ValveSetValvePositionParameters { Position = position });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void StopValve(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("valve", "stop_valve", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void Toggle(ServiceTarget target, object? data = null)
|
|
{
|
|
_haContext.CallService("valve", "toggle", target, data);
|
|
}
|
|
}
|
|
|
|
public partial record ValveSetValvePositionParameters
|
|
{
|
|
[JsonPropertyName("position")]
|
|
public long? Position { get; init; }
|
|
}
|
|
|
|
public partial class WeatherServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public WeatherServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void GetForecasts(ServiceTarget target, WeatherGetForecastsParameters data)
|
|
{
|
|
_haContext.CallService("weather", "get_forecasts", target, data);
|
|
}
|
|
|
|
///<param name="type"></param>
|
|
public void GetForecasts(ServiceTarget target, object @type)
|
|
{
|
|
_haContext.CallService("weather", "get_forecasts", target, new WeatherGetForecastsParameters { Type = @type });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public Task<JsonElement?> GetForecastsAsync(ServiceTarget target, WeatherGetForecastsParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("weather", "get_forecasts", target, data);
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
///<param name="type"></param>
|
|
public Task<JsonElement?> GetForecastsAsync(ServiceTarget target, object @type)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("weather", "get_forecasts", target, new WeatherGetForecastsParameters { Type = @type });
|
|
}
|
|
}
|
|
|
|
public partial record WeatherGetForecastsParameters
|
|
{
|
|
[JsonPropertyName("type")]
|
|
public object? Type { get; init; }
|
|
}
|
|
|
|
public partial class ZhaServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ZhaServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void ClearLockUserCode(ServiceTarget target, ZhaClearLockUserCodeParameters data)
|
|
{
|
|
_haContext.CallService("zha", "clear_lock_user_code", target, data);
|
|
}
|
|
|
|
///<param name="codeSlot"> eg: 1</param>
|
|
public void ClearLockUserCode(ServiceTarget target, string codeSlot)
|
|
{
|
|
_haContext.CallService("zha", "clear_lock_user_code", target, new ZhaClearLockUserCodeParameters { CodeSlot = codeSlot });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void DisableLockUserCode(ServiceTarget target, ZhaDisableLockUserCodeParameters data)
|
|
{
|
|
_haContext.CallService("zha", "disable_lock_user_code", target, data);
|
|
}
|
|
|
|
///<param name="codeSlot"> eg: 1</param>
|
|
public void DisableLockUserCode(ServiceTarget target, string codeSlot)
|
|
{
|
|
_haContext.CallService("zha", "disable_lock_user_code", target, new ZhaDisableLockUserCodeParameters { CodeSlot = codeSlot });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void EnableLockUserCode(ServiceTarget target, ZhaEnableLockUserCodeParameters data)
|
|
{
|
|
_haContext.CallService("zha", "enable_lock_user_code", target, data);
|
|
}
|
|
|
|
///<param name="codeSlot"> eg: 1</param>
|
|
public void EnableLockUserCode(ServiceTarget target, string codeSlot)
|
|
{
|
|
_haContext.CallService("zha", "enable_lock_user_code", target, new ZhaEnableLockUserCodeParameters { CodeSlot = codeSlot });
|
|
}
|
|
|
|
public void IssueZigbeeClusterCommand(ZhaIssueZigbeeClusterCommandParameters data)
|
|
{
|
|
_haContext.CallService("zha", "issue_zigbee_cluster_command", null, data);
|
|
}
|
|
|
|
///<param name="ieee"> eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpointId"></param>
|
|
///<param name="clusterId"></param>
|
|
///<param name="clusterType"></param>
|
|
///<param name="command"></param>
|
|
///<param name="commandType"></param>
|
|
///<param name="args"> eg: [arg1, arg2, argN]</param>
|
|
///<param name="params"></param>
|
|
///<param name="manufacturer"> eg: 252</param>
|
|
public void IssueZigbeeClusterCommand(string ieee, long endpointId, long clusterId, long command, object commandType, object? clusterType = null, object? args = null, object? @params = null, string? manufacturer = null)
|
|
{
|
|
_haContext.CallService("zha", "issue_zigbee_cluster_command", null, new ZhaIssueZigbeeClusterCommandParameters { Ieee = ieee, EndpointId = endpointId, ClusterId = clusterId, ClusterType = clusterType, Command = command, CommandType = commandType, Args = args, Params = @params, Manufacturer = manufacturer });
|
|
}
|
|
|
|
public void IssueZigbeeGroupCommand(ZhaIssueZigbeeGroupCommandParameters data)
|
|
{
|
|
_haContext.CallService("zha", "issue_zigbee_group_command", null, data);
|
|
}
|
|
|
|
///<param name="group"> eg: 546</param>
|
|
///<param name="clusterId"></param>
|
|
///<param name="clusterType"></param>
|
|
///<param name="command"></param>
|
|
///<param name="args"> eg: [arg1, arg2, argN]</param>
|
|
///<param name="manufacturer"> eg: 252</param>
|
|
public void IssueZigbeeGroupCommand(string @group, long clusterId, long command, object? clusterType = null, object? args = null, string? manufacturer = null)
|
|
{
|
|
_haContext.CallService("zha", "issue_zigbee_group_command", null, new ZhaIssueZigbeeGroupCommandParameters { Group = @group, ClusterId = clusterId, ClusterType = clusterType, Command = command, Args = args, Manufacturer = manufacturer });
|
|
}
|
|
|
|
public void Permit(ZhaPermitParameters data)
|
|
{
|
|
_haContext.CallService("zha", "permit", null, data);
|
|
}
|
|
|
|
///<param name="duration"></param>
|
|
///<param name="ieee"> eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="sourceIeee"> eg: 00:0a:bf:00:01:10:23:35</param>
|
|
///<param name="installCode"> eg: 1234-5678-1234-5678-AABB-CCDD-AABB-CCDD-EEFF</param>
|
|
///<param name="qrCode"> eg: Z:000D6FFFFED4163B$I:52797BF4A5084DAA8E1712B61741CA024051</param>
|
|
public void Permit(long? duration = null, string? ieee = null, string? sourceIeee = null, string? installCode = null, string? qrCode = null)
|
|
{
|
|
_haContext.CallService("zha", "permit", null, new ZhaPermitParameters { Duration = duration, Ieee = ieee, SourceIeee = sourceIeee, InstallCode = installCode, QrCode = qrCode });
|
|
}
|
|
|
|
public void Remove(ZhaRemoveParameters data)
|
|
{
|
|
_haContext.CallService("zha", "remove", null, data);
|
|
}
|
|
|
|
///<param name="ieee"> eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
public void Remove(string ieee)
|
|
{
|
|
_haContext.CallService("zha", "remove", null, new ZhaRemoveParameters { Ieee = ieee });
|
|
}
|
|
|
|
///<param name="target">The target for this service call</param>
|
|
public void SetLockUserCode(ServiceTarget target, ZhaSetLockUserCodeParameters data)
|
|
{
|
|
_haContext.CallService("zha", "set_lock_user_code", target, data);
|
|
}
|
|
|
|
///<param name="codeSlot"> eg: 1</param>
|
|
///<param name="userCode"> eg: 1234</param>
|
|
public void SetLockUserCode(ServiceTarget target, string codeSlot, string userCode)
|
|
{
|
|
_haContext.CallService("zha", "set_lock_user_code", target, new ZhaSetLockUserCodeParameters { CodeSlot = codeSlot, UserCode = userCode });
|
|
}
|
|
|
|
public void SetZigbeeClusterAttribute(ZhaSetZigbeeClusterAttributeParameters data)
|
|
{
|
|
_haContext.CallService("zha", "set_zigbee_cluster_attribute", null, data);
|
|
}
|
|
|
|
///<param name="ieee"> eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpointId"></param>
|
|
///<param name="clusterId"></param>
|
|
///<param name="clusterType"></param>
|
|
///<param name="attribute"> eg: 0</param>
|
|
///<param name="value"> eg: 1</param>
|
|
///<param name="manufacturer"> eg: 252</param>
|
|
public void SetZigbeeClusterAttribute(string ieee, long endpointId, long clusterId, long attribute, string value, object? clusterType = null, string? manufacturer = null)
|
|
{
|
|
_haContext.CallService("zha", "set_zigbee_cluster_attribute", null, new ZhaSetZigbeeClusterAttributeParameters { Ieee = ieee, EndpointId = endpointId, ClusterId = clusterId, ClusterType = clusterType, Attribute = attribute, Value = value, Manufacturer = manufacturer });
|
|
}
|
|
|
|
public void WarningDeviceSquawk(ZhaWarningDeviceSquawkParameters data)
|
|
{
|
|
_haContext.CallService("zha", "warning_device_squawk", null, data);
|
|
}
|
|
|
|
///<param name="ieee"> eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="mode"></param>
|
|
///<param name="strobe"></param>
|
|
///<param name="level"></param>
|
|
public void WarningDeviceSquawk(string ieee, long? mode = null, long? strobe = null, long? level = null)
|
|
{
|
|
_haContext.CallService("zha", "warning_device_squawk", null, new ZhaWarningDeviceSquawkParameters { Ieee = ieee, Mode = mode, Strobe = strobe, Level = level });
|
|
}
|
|
|
|
public void WarningDeviceWarn(ZhaWarningDeviceWarnParameters data)
|
|
{
|
|
_haContext.CallService("zha", "warning_device_warn", null, data);
|
|
}
|
|
|
|
///<param name="ieee"> eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="mode"></param>
|
|
///<param name="strobe"></param>
|
|
///<param name="level"></param>
|
|
///<param name="duration"></param>
|
|
///<param name="dutyCycle"></param>
|
|
///<param name="intensity"></param>
|
|
public void WarningDeviceWarn(string ieee, long? mode = null, long? strobe = null, long? level = null, long? duration = null, long? dutyCycle = null, long? intensity = null)
|
|
{
|
|
_haContext.CallService("zha", "warning_device_warn", null, new ZhaWarningDeviceWarnParameters { Ieee = ieee, Mode = mode, Strobe = strobe, Level = level, Duration = duration, DutyCycle = dutyCycle, Intensity = intensity });
|
|
}
|
|
}
|
|
|
|
public partial record ZhaClearLockUserCodeParameters
|
|
{
|
|
///<summary> eg: 1</summary>
|
|
[JsonPropertyName("code_slot")]
|
|
public string? CodeSlot { get; init; }
|
|
}
|
|
|
|
public partial record ZhaDisableLockUserCodeParameters
|
|
{
|
|
///<summary> eg: 1</summary>
|
|
[JsonPropertyName("code_slot")]
|
|
public string? CodeSlot { get; init; }
|
|
}
|
|
|
|
public partial record ZhaEnableLockUserCodeParameters
|
|
{
|
|
///<summary> eg: 1</summary>
|
|
[JsonPropertyName("code_slot")]
|
|
public string? CodeSlot { get; init; }
|
|
}
|
|
|
|
public partial record ZhaIssueZigbeeClusterCommandParameters
|
|
{
|
|
///<summary> eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
[JsonPropertyName("endpoint_id")]
|
|
public long? EndpointId { get; init; }
|
|
|
|
[JsonPropertyName("cluster_id")]
|
|
public long? ClusterId { get; init; }
|
|
|
|
[JsonPropertyName("cluster_type")]
|
|
public object? ClusterType { get; init; }
|
|
|
|
[JsonPropertyName("command")]
|
|
public long? Command { get; init; }
|
|
|
|
[JsonPropertyName("command_type")]
|
|
public object? CommandType { get; init; }
|
|
|
|
///<summary> eg: [arg1, arg2, argN]</summary>
|
|
[JsonPropertyName("args")]
|
|
public object? Args { get; init; }
|
|
|
|
[JsonPropertyName("params")]
|
|
public object? Params { get; init; }
|
|
|
|
///<summary> eg: 252</summary>
|
|
[JsonPropertyName("manufacturer")]
|
|
public string? Manufacturer { get; init; }
|
|
}
|
|
|
|
public partial record ZhaIssueZigbeeGroupCommandParameters
|
|
{
|
|
///<summary> eg: 546</summary>
|
|
[JsonPropertyName("group")]
|
|
public string? Group { get; init; }
|
|
|
|
[JsonPropertyName("cluster_id")]
|
|
public long? ClusterId { get; init; }
|
|
|
|
[JsonPropertyName("cluster_type")]
|
|
public object? ClusterType { get; init; }
|
|
|
|
[JsonPropertyName("command")]
|
|
public long? Command { get; init; }
|
|
|
|
///<summary> eg: [arg1, arg2, argN]</summary>
|
|
[JsonPropertyName("args")]
|
|
public object? Args { get; init; }
|
|
|
|
///<summary> eg: 252</summary>
|
|
[JsonPropertyName("manufacturer")]
|
|
public string? Manufacturer { get; init; }
|
|
}
|
|
|
|
public partial record ZhaPermitParameters
|
|
{
|
|
[JsonPropertyName("duration")]
|
|
public long? Duration { get; init; }
|
|
|
|
///<summary> eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary> eg: 00:0a:bf:00:01:10:23:35</summary>
|
|
[JsonPropertyName("source_ieee")]
|
|
public string? SourceIeee { get; init; }
|
|
|
|
///<summary> eg: 1234-5678-1234-5678-AABB-CCDD-AABB-CCDD-EEFF</summary>
|
|
[JsonPropertyName("install_code")]
|
|
public string? InstallCode { get; init; }
|
|
|
|
///<summary> eg: Z:000D6FFFFED4163B$I:52797BF4A5084DAA8E1712B61741CA024051</summary>
|
|
[JsonPropertyName("qr_code")]
|
|
public string? QrCode { get; init; }
|
|
}
|
|
|
|
public partial record ZhaRemoveParameters
|
|
{
|
|
///<summary> eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
}
|
|
|
|
public partial record ZhaSetLockUserCodeParameters
|
|
{
|
|
///<summary> eg: 1</summary>
|
|
[JsonPropertyName("code_slot")]
|
|
public string? CodeSlot { get; init; }
|
|
|
|
///<summary> eg: 1234</summary>
|
|
[JsonPropertyName("user_code")]
|
|
public string? UserCode { get; init; }
|
|
}
|
|
|
|
public partial record ZhaSetZigbeeClusterAttributeParameters
|
|
{
|
|
///<summary> eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
[JsonPropertyName("endpoint_id")]
|
|
public long? EndpointId { get; init; }
|
|
|
|
[JsonPropertyName("cluster_id")]
|
|
public long? ClusterId { get; init; }
|
|
|
|
[JsonPropertyName("cluster_type")]
|
|
public object? ClusterType { get; init; }
|
|
|
|
///<summary> eg: 0</summary>
|
|
[JsonPropertyName("attribute")]
|
|
public long? Attribute { get; init; }
|
|
|
|
///<summary> eg: 1</summary>
|
|
[JsonPropertyName("value")]
|
|
public string? Value { get; init; }
|
|
|
|
///<summary> eg: 252</summary>
|
|
[JsonPropertyName("manufacturer")]
|
|
public string? Manufacturer { get; init; }
|
|
}
|
|
|
|
public partial record ZhaWarningDeviceSquawkParameters
|
|
{
|
|
///<summary> eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
[JsonPropertyName("mode")]
|
|
public long? Mode { get; init; }
|
|
|
|
[JsonPropertyName("strobe")]
|
|
public long? Strobe { get; init; }
|
|
|
|
[JsonPropertyName("level")]
|
|
public long? Level { get; init; }
|
|
}
|
|
|
|
public partial record ZhaWarningDeviceWarnParameters
|
|
{
|
|
///<summary> eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
[JsonPropertyName("mode")]
|
|
public long? Mode { get; init; }
|
|
|
|
[JsonPropertyName("strobe")]
|
|
public long? Strobe { get; init; }
|
|
|
|
[JsonPropertyName("level")]
|
|
public long? Level { get; init; }
|
|
|
|
[JsonPropertyName("duration")]
|
|
public long? Duration { get; init; }
|
|
|
|
[JsonPropertyName("duty_cycle")]
|
|
public long? DutyCycle { get; init; }
|
|
|
|
[JsonPropertyName("intensity")]
|
|
public long? Intensity { get; init; }
|
|
}
|
|
|
|
public partial class ZhaToolkitServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ZhaToolkitServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Add group to endpoint groups list of device. May be equivalent to `add_to_group`</summary>
|
|
public void AddGroup(ZhaToolkitAddGroupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "add_group", null, data);
|
|
}
|
|
|
|
///<summary>Add group to endpoint groups list of device. May be equivalent to `add_to_group`</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to get information for (all endpoints when not set)</param>
|
|
///<param name="commandData">Group id to add eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void AddGroup(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "add_group", null, new ZhaToolkitAddGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Add group to endpoint groups list of device. May be equivalent to `add_to_group`</summary>
|
|
public Task<JsonElement?> AddGroupAsync(ZhaToolkitAddGroupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "add_group", null, data);
|
|
}
|
|
|
|
///<summary>Add group to endpoint groups list of device. May be equivalent to `add_to_group`</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to get information for (all endpoints when not set)</param>
|
|
///<param name="commandData">Group id to add eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> AddGroupAsync(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "add_group", null, new ZhaToolkitAddGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Add device to group</summary>
|
|
public void AddToGroup(ZhaToolkitAddToGroupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "add_to_group", null, data);
|
|
}
|
|
|
|
///<summary>Add device to group</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (or all EP if not set)</param>
|
|
///<param name="commandData">Group id to remove eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void AddToGroup(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "add_to_group", null, new ZhaToolkitAddToGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Add device to group</summary>
|
|
public Task<JsonElement?> AddToGroupAsync(ZhaToolkitAddToGroupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "add_to_group", null, data);
|
|
}
|
|
|
|
///<summary>Add device to group</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (or all EP if not set)</param>
|
|
///<param name="commandData">Group id to remove eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> AddToGroupAsync(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "add_to_group", null, new ZhaToolkitAddToGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
public void AllRoutesAndNeighbours(ZhaToolkitAllRoutesAndNeighboursParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "all_routes_and_neighbours", null, data);
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void AllRoutesAndNeighbours(string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "all_routes_and_neighbours", null, new ZhaToolkitAllRoutesAndNeighboursParameters { EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
public Task<JsonElement?> AllRoutesAndNeighboursAsync(ZhaToolkitAllRoutesAndNeighboursParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "all_routes_and_neighbours", null, data);
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> AllRoutesAndNeighboursAsync(string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "all_routes_and_neighbours", null, new ZhaToolkitAllRoutesAndNeighboursParameters { EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Read Attribute</summary>
|
|
public void AttrRead(ZhaToolkitAttrReadParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "attr_read", null, data);
|
|
}
|
|
|
|
///<summary>Read Attribute</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">When defined, name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="stateValueTemplate">When defined, the read attribute is converted using this template before writing it to the state. eg: value / 100</param>
|
|
///<param name="forceUpdate">Force an update event when the state is written When not set or false, if the state value is unchanged, the update may not trigger an automation. eg: True</param>
|
|
///<param name="useCache">Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning where it falls back to an actual read when the value is not in cache. eg: True</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Label to use for read value (in CSV file) eg: SecretAttributeName</param>
|
|
public void AttrRead(string ieee, long cluster, long attribute, long? manf = null, long? endpoint = null, long? tries = null, string? stateId = null, string? stateAttr = null, string? stateValueTemplate = null, bool? forceUpdate = null, bool? useCache = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? allowCreate = null, bool? expectReply = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "attr_read", null, new ZhaToolkitAttrReadParameters { Ieee = ieee, Manf = manf, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, Tries = tries, StateId = stateId, StateAttr = stateAttr, StateValueTemplate = stateValueTemplate, ForceUpdate = forceUpdate, UseCache = useCache, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, AllowCreate = allowCreate, ExpectReply = expectReply, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
///<summary>Read Attribute</summary>
|
|
public Task<JsonElement?> AttrReadAsync(ZhaToolkitAttrReadParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "attr_read", null, data);
|
|
}
|
|
|
|
///<summary>Read Attribute</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">When defined, name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="stateValueTemplate">When defined, the read attribute is converted using this template before writing it to the state. eg: value / 100</param>
|
|
///<param name="forceUpdate">Force an update event when the state is written When not set or false, if the state value is unchanged, the update may not trigger an automation. eg: True</param>
|
|
///<param name="useCache">Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning where it falls back to an actual read when the value is not in cache. eg: True</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Label to use for read value (in CSV file) eg: SecretAttributeName</param>
|
|
public Task<JsonElement?> AttrReadAsync(string ieee, long cluster, long attribute, long? manf = null, long? endpoint = null, long? tries = null, string? stateId = null, string? stateAttr = null, string? stateValueTemplate = null, bool? forceUpdate = null, bool? useCache = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? allowCreate = null, bool? expectReply = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "attr_read", null, new ZhaToolkitAttrReadParameters { Ieee = ieee, Manf = manf, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, Tries = tries, StateId = stateId, StateAttr = stateAttr, StateValueTemplate = stateValueTemplate, ForceUpdate = forceUpdate, UseCache = useCache, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, AllowCreate = allowCreate, ExpectReply = expectReply, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
///<summary>Write Attribute</summary>
|
|
public void AttrWrite(ZhaToolkitAttrWriteParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "attr_write", null, data);
|
|
}
|
|
|
|
///<summary>Write Attribute</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="attrType">Attribute type (to write, ...)</param>
|
|
///<param name="attrVal">Attribute value to write</param>
|
|
///<param name="useCache">Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning where it falls back to an actual read (when reading before a write) when the value is not in cache. eg: True</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">When defined, name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="readBeforeWrite">Read attribute before writing it (used with attr_write). When the read value matches the value to write, no write is done. Defaults to True.</param>
|
|
///<param name="readAfterWrite">Read attribute after writing. Can be used to ensure the values match. Defaults to True</param>
|
|
///<param name="writeIfEqual">Force writing the attribute even if the read attribute already matches. Defaults to False</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Label to use for read value (in CSV file) eg: SecretAttributeName</param>
|
|
public void AttrWrite(string ieee, long cluster, long attribute, string attrVal, long? manf = null, long? endpoint = null, long? attrType = null, bool? useCache = null, long? tries = null, string? stateId = null, string? stateAttr = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? allowCreate = null, bool? readBeforeWrite = null, bool? readAfterWrite = null, bool? writeIfEqual = null, bool? expectReply = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "attr_write", null, new ZhaToolkitAttrWriteParameters { Ieee = ieee, Manf = manf, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, AttrType = attrType, AttrVal = attrVal, UseCache = useCache, Tries = tries, StateId = stateId, StateAttr = stateAttr, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, AllowCreate = allowCreate, ReadBeforeWrite = readBeforeWrite, ReadAfterWrite = readAfterWrite, WriteIfEqual = writeIfEqual, ExpectReply = expectReply, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
///<summary>Write Attribute</summary>
|
|
public Task<JsonElement?> AttrWriteAsync(ZhaToolkitAttrWriteParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "attr_write", null, data);
|
|
}
|
|
|
|
///<summary>Write Attribute</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="attrType">Attribute type (to write, ...)</param>
|
|
///<param name="attrVal">Attribute value to write</param>
|
|
///<param name="useCache">Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning where it falls back to an actual read (when reading before a write) when the value is not in cache. eg: True</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">When defined, name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="readBeforeWrite">Read attribute before writing it (used with attr_write). When the read value matches the value to write, no write is done. Defaults to True.</param>
|
|
///<param name="readAfterWrite">Read attribute after writing. Can be used to ensure the values match. Defaults to True</param>
|
|
///<param name="writeIfEqual">Force writing the attribute even if the read attribute already matches. Defaults to False</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Label to use for read value (in CSV file) eg: SecretAttributeName</param>
|
|
public Task<JsonElement?> AttrWriteAsync(string ieee, long cluster, long attribute, string attrVal, long? manf = null, long? endpoint = null, long? attrType = null, bool? useCache = null, long? tries = null, string? stateId = null, string? stateAttr = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? allowCreate = null, bool? readBeforeWrite = null, bool? readAfterWrite = null, bool? writeIfEqual = null, bool? expectReply = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "attr_write", null, new ZhaToolkitAttrWriteParameters { Ieee = ieee, Manf = manf, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, AttrType = attrType, AttrVal = attrVal, UseCache = useCache, Tries = tries, StateId = stateId, StateAttr = stateAttr, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, AllowCreate = allowCreate, ReadBeforeWrite = readBeforeWrite, ReadAfterWrite = readAfterWrite, WriteIfEqual = writeIfEqual, ExpectReply = expectReply, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
public void Backup(ZhaToolkitBackupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "backup", null, data);
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
///<param name="commandData">Suffix for backup file eg: _bathroom_added</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void Backup(string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "backup", null, new ZhaToolkitBackupParameters { CommandData = commandData, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
public Task<JsonElement?> BackupAsync(ZhaToolkitBackupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "backup", null, data);
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
///<param name="commandData">Suffix for backup file eg: _bathroom_added</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> BackupAsync(string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "backup", null, new ZhaToolkitBackupParameters { CommandData = commandData, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
public void BindGroup(ZhaToolkitBindGroupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "bind_group", null, data);
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Target group for binding eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">Target endpoint (when missing: all endpoints)</param>
|
|
///<param name="cluster">Target cluster (when missing: all internally defined cluster)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void BindGroup(string ieee, long commandData, long? endpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "bind_group", null, new ZhaToolkitBindGroupParameters { Ieee = ieee, CommandData = commandData, Endpoint = endpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
public Task<JsonElement?> BindGroupAsync(ZhaToolkitBindGroupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "bind_group", null, data);
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Target group for binding eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">Target endpoint (when missing: all endpoints)</param>
|
|
///<param name="cluster">Target cluster (when missing: all internally defined cluster)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> BindGroupAsync(string ieee, long commandData, long? endpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "bind_group", null, new ZhaToolkitBindGroupParameters { Ieee = ieee, CommandData = commandData, Endpoint = endpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
public void BindIeee(ZhaToolkitBindIeeeParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "bind_ieee", null, data);
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Binding target (Entity name, device name, or IEEE address of the node to execute command). By default: coordinator eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">Target endpoint (when missing: all endpoints)</param>
|
|
///<param name="dstEndpoint">Destination endpoint (when missing: first EP with matching cluster)</param>
|
|
///<param name="cluster">Target cluster (or all internally defined ones)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void BindIeee(string ieee, string? commandData = null, long? endpoint = null, long? dstEndpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "bind_ieee", null, new ZhaToolkitBindIeeeParameters { Ieee = ieee, CommandData = commandData, Endpoint = endpoint, DstEndpoint = dstEndpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
public Task<JsonElement?> BindIeeeAsync(ZhaToolkitBindIeeeParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "bind_ieee", null, data);
|
|
}
|
|
|
|
///<summary>Bind clusters from ieee device to command_data device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Binding target (Entity name, device name, or IEEE address of the node to execute command). By default: coordinator eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">Target endpoint (when missing: all endpoints)</param>
|
|
///<param name="dstEndpoint">Destination endpoint (when missing: first EP with matching cluster)</param>
|
|
///<param name="cluster">Target cluster (or all internally defined ones)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> BindIeeeAsync(string ieee, string? commandData = null, long? endpoint = null, long? dstEndpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "bind_ieee", null, new ZhaToolkitBindIeeeParameters { Ieee = ieee, CommandData = commandData, Endpoint = endpoint, DstEndpoint = dstEndpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Get binding table from device.</summary>
|
|
public void BindsGet(ZhaToolkitBindsGetParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "binds_get", null, data);
|
|
}
|
|
|
|
///<summary>Get binding table from device.</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void BindsGet(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "binds_get", null, new ZhaToolkitBindsGetParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Get binding table from device.</summary>
|
|
public Task<JsonElement?> BindsGetAsync(ZhaToolkitBindsGetParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "binds_get", null, data);
|
|
}
|
|
|
|
///<summary>Get binding table from device.</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> BindsGetAsync(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "binds_get", null, new ZhaToolkitBindsGetParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device</summary>
|
|
public void BindsRemoveAll(ZhaToolkitBindsRemoveAllParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "binds_remove_all", null, data);
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">When provided, remove only bindings towards this device (Entity name, device name, or IEEE address of the binding destination) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">When provided, remove only bindings for this endpoint or list of endpoints (single value or list. Example: 20 or [20, 30]) Otherwise: removes bindings for all endpoints</param>
|
|
///<param name="cluster">When provided, remove only bindings for this cluster or list of clusters (single value or list. Example: 0x0200 or [0x200, 0x300]) Otherwise: removes bindings for all clusters</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void BindsRemoveAll(string ieee, string? commandData = null, long? endpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "binds_remove_all", null, new ZhaToolkitBindsRemoveAllParameters { Ieee = ieee, CommandData = commandData, Endpoint = endpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device</summary>
|
|
public Task<JsonElement?> BindsRemoveAllAsync(ZhaToolkitBindsRemoveAllParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "binds_remove_all", null, data);
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">When provided, remove only bindings towards this device (Entity name, device name, or IEEE address of the binding destination) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">When provided, remove only bindings for this endpoint or list of endpoints (single value or list. Example: 20 or [20, 30]) Otherwise: removes bindings for all endpoints</param>
|
|
///<param name="cluster">When provided, remove only bindings for this cluster or list of clusters (single value or list. Example: 0x0200 or [0x200, 0x300]) Otherwise: removes bindings for all clusters</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> BindsRemoveAllAsync(string ieee, string? commandData = null, long? endpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "binds_remove_all", null, new ZhaToolkitBindsRemoveAllParameters { Ieee = ieee, CommandData = commandData, Endpoint = endpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Configure attribute reporting. You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
public void ConfReport(ZhaToolkitConfReportParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "conf_report", null, data);
|
|
}
|
|
|
|
///<summary>Configure attribute reporting. You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="minInterval">Minimum report interval (seconds)</param>
|
|
///<param name="maxInterval">Maximum report interval (seconds)</param>
|
|
///<param name="reportableChange">Minimum change before reporting</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void ConfReport(string ieee, long cluster, long attribute, long minInterval, long maxInterval, long reportableChange, long? endpoint = null, long? manf = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "conf_report", null, new ZhaToolkitConfReportParameters { Ieee = ieee, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, MinInterval = minInterval, MaxInterval = maxInterval, ReportableChange = reportableChange, Manf = manf, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Configure attribute reporting. You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
public Task<JsonElement?> ConfReportAsync(ZhaToolkitConfReportParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "conf_report", null, data);
|
|
}
|
|
|
|
///<summary>Configure attribute reporting. You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="minInterval">Minimum report interval (seconds)</param>
|
|
///<param name="maxInterval">Maximum report interval (seconds)</param>
|
|
///<param name="reportableChange">Minimum change before reporting</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> ConfReportAsync(string ieee, long cluster, long attribute, long minInterval, long maxInterval, long reportableChange, long? endpoint = null, long? manf = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "conf_report", null, new ZhaToolkitConfReportParameters { Ieee = ieee, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, MinInterval = minInterval, MaxInterval = maxInterval, ReportableChange = reportableChange, Manf = manf, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Read attribute report configuration You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
public void ConfReportRead(ZhaToolkitConfReportReadParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "conf_report_read", null, data);
|
|
}
|
|
|
|
///<summary>Read attribute report configuration You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases), can be a list</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void ConfReportRead(string ieee, long cluster, long attribute, long? endpoint = null, long? manf = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "conf_report_read", null, new ZhaToolkitConfReportReadParameters { Ieee = ieee, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, Manf = manf, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Read attribute report configuration You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
public Task<JsonElement?> ConfReportReadAsync(ZhaToolkitConfReportReadParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "conf_report_read", null, data);
|
|
}
|
|
|
|
///<summary>Read attribute report configuration You can set a high value for tries (100 or more) for sleepy devices."</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases), can be a list</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> ConfReportReadAsync(string ieee, long cluster, long attribute, long? endpoint = null, long? manf = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "conf_report_read", null, new ZhaToolkitConfReportReadParameters { Ieee = ieee, Endpoint = endpoint, Cluster = cluster, Attribute = attribute, Manf = manf, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Execute ZHA Toolkit service (Examine the documentation or code to know which parameters are needed)</summary>
|
|
public void Execute(ZhaToolkitExecuteParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "execute", null, data);
|
|
}
|
|
|
|
///<summary>Execute ZHA Toolkit service (Examine the documentation or code to know which parameters are needed)</summary>
|
|
///<param name="command">Command name eg: scan_device</param>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">data for the command (specific command. Example, second IEEE address for binding) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="cmd">Command Id (zcl_cmd)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="dstEndpoint">destination endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="attrType">Attribute type (to write, ...)</param>
|
|
///<param name="attrVal">Attribute value to write</param>
|
|
///<param name="minInterval">Minimum report interval (seconds)</param>
|
|
///<param name="maxInterval">Maximum report interval (seconds)</param>
|
|
///<param name="reportableChange">Minimum change before reporting</param>
|
|
///<param name="dir">Direction indicator, according to command</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">When defined, name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="stateValueTemplate">When defined, the read attribute is converted using this template before writing it to the state. eg: value / 100</param>
|
|
///<param name="forceUpdate">Force an update event when the state is written When not set or false, if the state value is unchanged, the update may not trigger an automation. eg: True</param>
|
|
///<param name="useCache">Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning with attr_write where it falls back to an actual read when the value is not in cache. eg: True</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="readBeforeWrite">Read attribute before writing it (used with attr_write). When the read value matches the value to write, no write is done. Defaults to True.</param>
|
|
///<param name="readAfterWrite">Read attribute after writing. Can be used to ensure the values match. Defaults to True</param>
|
|
///<param name="writeIfEqual">Force writing the attribute even if the read attribute already matches. Defaults to False</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Label to use for read value (in CSV file) eg: SecretAttributeName</param>
|
|
public void Execute(object command, string? ieee = null, string? commandData = null, long? manf = null, long? cmd = null, long? endpoint = null, long? dstEndpoint = null, long? cluster = null, long? attribute = null, long? attrType = null, string? attrVal = null, long? minInterval = null, long? maxInterval = null, long? reportableChange = null, long? dir = null, long? tries = null, string? stateId = null, string? stateAttr = null, string? stateValueTemplate = null, bool? forceUpdate = null, bool? useCache = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? allowCreate = null, bool? readBeforeWrite = null, bool? readAfterWrite = null, bool? writeIfEqual = null, bool? expectReply = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "execute", null, new ZhaToolkitExecuteParameters { Command = command, Ieee = ieee, CommandData = commandData, Manf = manf, Cmd = cmd, Endpoint = endpoint, DstEndpoint = dstEndpoint, Cluster = cluster, Attribute = attribute, AttrType = attrType, AttrVal = attrVal, MinInterval = minInterval, MaxInterval = maxInterval, ReportableChange = reportableChange, Dir = dir, Tries = tries, StateId = stateId, StateAttr = stateAttr, StateValueTemplate = stateValueTemplate, ForceUpdate = forceUpdate, UseCache = useCache, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, AllowCreate = allowCreate, ReadBeforeWrite = readBeforeWrite, ReadAfterWrite = readAfterWrite, WriteIfEqual = writeIfEqual, ExpectReply = expectReply, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
///<summary>Execute ZHA Toolkit service (Examine the documentation or code to know which parameters are needed)</summary>
|
|
public Task<JsonElement?> ExecuteAsync(ZhaToolkitExecuteParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "execute", null, data);
|
|
}
|
|
|
|
///<summary>Execute ZHA Toolkit service (Examine the documentation or code to know which parameters are needed)</summary>
|
|
///<param name="command">Command name eg: scan_device</param>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">data for the command (specific command. Example, second IEEE address for binding) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="cmd">Command Id (zcl_cmd)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="dstEndpoint">destination endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="attribute">target attribute id (or name, accepted in most cases)</param>
|
|
///<param name="attrType">Attribute type (to write, ...)</param>
|
|
///<param name="attrVal">Attribute value to write</param>
|
|
///<param name="minInterval">Minimum report interval (seconds)</param>
|
|
///<param name="maxInterval">Maximum report interval (seconds)</param>
|
|
///<param name="reportableChange">Minimum change before reporting</param>
|
|
///<param name="dir">Direction indicator, according to command</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">When defined, name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="stateValueTemplate">When defined, the read attribute is converted using this template before writing it to the state. eg: value / 100</param>
|
|
///<param name="forceUpdate">Force an update event when the state is written When not set or false, if the state value is unchanged, the update may not trigger an automation. eg: True</param>
|
|
///<param name="useCache">Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning with attr_write where it falls back to an actual read when the value is not in cache. eg: True</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="readBeforeWrite">Read attribute before writing it (used with attr_write). When the read value matches the value to write, no write is done. Defaults to True.</param>
|
|
///<param name="readAfterWrite">Read attribute after writing. Can be used to ensure the values match. Defaults to True</param>
|
|
///<param name="writeIfEqual">Force writing the attribute even if the read attribute already matches. Defaults to False</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Label to use for read value (in CSV file) eg: SecretAttributeName</param>
|
|
public Task<JsonElement?> ExecuteAsync(object command, string? ieee = null, string? commandData = null, long? manf = null, long? cmd = null, long? endpoint = null, long? dstEndpoint = null, long? cluster = null, long? attribute = null, long? attrType = null, string? attrVal = null, long? minInterval = null, long? maxInterval = null, long? reportableChange = null, long? dir = null, long? tries = null, string? stateId = null, string? stateAttr = null, string? stateValueTemplate = null, bool? forceUpdate = null, bool? useCache = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? allowCreate = null, bool? readBeforeWrite = null, bool? readAfterWrite = null, bool? writeIfEqual = null, bool? expectReply = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "execute", null, new ZhaToolkitExecuteParameters { Command = command, Ieee = ieee, CommandData = commandData, Manf = manf, Cmd = cmd, Endpoint = endpoint, DstEndpoint = dstEndpoint, Cluster = cluster, Attribute = attribute, AttrType = attrType, AttrVal = attrVal, MinInterval = minInterval, MaxInterval = maxInterval, ReportableChange = reportableChange, Dir = dir, Tries = tries, StateId = stateId, StateAttr = stateAttr, StateValueTemplate = stateValueTemplate, ForceUpdate = forceUpdate, UseCache = useCache, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, AllowCreate = allowCreate, ReadBeforeWrite = readBeforeWrite, ReadAfterWrite = readAfterWrite, WriteIfEqual = writeIfEqual, ExpectReply = expectReply, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
public void EzspAddKey(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_add_key", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspAddKeyAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_add_key", null, data);
|
|
}
|
|
|
|
///<summary>Backup coordinator data (bellows/ezsp)</summary>
|
|
public void EzspBackup(ZhaToolkitEzspBackupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_backup", null, data);
|
|
}
|
|
|
|
///<summary>Backup coordinator data (bellows/ezsp)</summary>
|
|
///<param name="commandData">Suffix for backup file eg: _bathroom_added</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void EzspBackup(string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_backup", null, new ZhaToolkitEzspBackupParameters { CommandData = commandData, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Backup coordinator data (bellows/ezsp)</summary>
|
|
public Task<JsonElement?> EzspBackupAsync(ZhaToolkitEzspBackupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_backup", null, data);
|
|
}
|
|
|
|
///<summary>Backup coordinator data (bellows/ezsp)</summary>
|
|
///<param name="commandData">Suffix for backup file eg: _bathroom_added</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> EzspBackupAsync(string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_backup", null, new ZhaToolkitEzspBackupParameters { CommandData = commandData, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
public void EzspClearKeys(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_clear_keys", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspClearKeysAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_clear_keys", null, data);
|
|
}
|
|
|
|
public void EzspGetConfigValue(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_get_config_value", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspGetConfigValueAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_get_config_value", null, data);
|
|
}
|
|
|
|
public void EzspGetIeeeByNwk(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_get_ieee_by_nwk", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspGetIeeeByNwkAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_get_ieee_by_nwk", null, data);
|
|
}
|
|
|
|
public void EzspGetKeys(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_get_keys", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspGetKeysAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_get_keys", null, data);
|
|
}
|
|
|
|
public void EzspGetPolicy(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_get_policy", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspGetPolicyAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_get_policy", null, data);
|
|
}
|
|
|
|
public void EzspGetToken(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_get_token", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspGetTokenAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_get_token", null, data);
|
|
}
|
|
|
|
public void EzspGetValue(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_get_value", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspGetValueAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_get_value", null, data);
|
|
}
|
|
|
|
public void EzspSetChannel(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_set_channel", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspSetChannelAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_set_channel", null, data);
|
|
}
|
|
|
|
public void EzspStartMfg(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ezsp_start_mfg", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> EzspStartMfgAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ezsp_start_mfg", null, data);
|
|
}
|
|
|
|
///<summary>Get groups set on the endpoints of the device</summary>
|
|
public void GetGroups(ZhaToolkitGetGroupsParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "get_groups", null, data);
|
|
}
|
|
|
|
///<summary>Get groups set on the endpoints of the device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to get information for (all endpoints when not set)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void GetGroups(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "get_groups", null, new ZhaToolkitGetGroupsParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Get groups set on the endpoints of the device</summary>
|
|
public Task<JsonElement?> GetGroupsAsync(ZhaToolkitGetGroupsParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "get_groups", null, data);
|
|
}
|
|
|
|
///<summary>Get groups set on the endpoints of the device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to get information for (all endpoints when not set)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> GetGroupsAsync(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "get_groups", null, new ZhaToolkitGetGroupsParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
public void GetRoutesAndNeighbours(ZhaToolkitGetRoutesAndNeighboursParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "get_routes_and_neighbours", null, data);
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void GetRoutesAndNeighbours(string ieee, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "get_routes_and_neighbours", null, new ZhaToolkitGetRoutesAndNeighboursParameters { Ieee = ieee, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
public Task<JsonElement?> GetRoutesAndNeighboursAsync(ZhaToolkitGetRoutesAndNeighboursParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "get_routes_and_neighbours", null, data);
|
|
}
|
|
|
|
///<summary>Scan for all routes and neighbours, results saved to config/scans/...</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> GetRoutesAndNeighboursAsync(string ieee, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "get_routes_and_neighbours", null, new ZhaToolkitGetRoutesAndNeighboursParameters { Ieee = ieee, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Get groups for zll_cluster (if present)</summary>
|
|
public void GetZllGroups(ZhaToolkitGetZllGroupsParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "get_zll_groups", null, data);
|
|
}
|
|
|
|
///<summary>Get groups for zll_cluster (if present)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void GetZllGroups(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "get_zll_groups", null, new ZhaToolkitGetZllGroupsParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Get groups for zll_cluster (if present)</summary>
|
|
public Task<JsonElement?> GetZllGroupsAsync(ZhaToolkitGetZllGroupsParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "get_zll_groups", null, data);
|
|
}
|
|
|
|
///<summary>Get groups for zll_cluster (if present)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> GetZllGroupsAsync(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "get_zll_groups", null, new ZhaToolkitGetZllGroupsParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Set/update a Home Assistant state</summary>
|
|
public void HaSetState(ZhaToolkitHaSetStateParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ha_set_state", null, data);
|
|
}
|
|
|
|
///<summary>Set/update a Home Assistant state</summary>
|
|
///<param name="attrVal">value to write to the state (or use in the template)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">Name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="stateValueTemplate">When defined, used as a template expression. For example "value + 10" will be internally interpreted as "{{ value + 10 }}" where 'value' is substituted with the value for 'attr_val' eg: value + 10</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="csvout">Filename of CSV to write the update state information to. Written to 'csv' directory. eg: ../web/mystatecsv.csv</param>
|
|
///<param name="csvlabel">Label to designate value written (in CSV file) eg: Updated from zha_toolkit.ha_set_state</param>
|
|
public void HaSetState(string attrVal, string stateId, long? tries = null, string? stateAttr = null, string? stateValueTemplate = null, bool? allowCreate = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ha_set_state", null, new ZhaToolkitHaSetStateParameters { AttrVal = attrVal, Tries = tries, StateId = stateId, StateAttr = stateAttr, StateValueTemplate = stateValueTemplate, AllowCreate = allowCreate, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
///<summary>Set/update a Home Assistant state</summary>
|
|
public Task<JsonElement?> HaSetStateAsync(ZhaToolkitHaSetStateParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ha_set_state", null, data);
|
|
}
|
|
|
|
///<summary>Set/update a Home Assistant state</summary>
|
|
///<param name="attrVal">value to write to the state (or use in the template)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="stateId">Name of state to write the read attribute value to eg: sensor.example</param>
|
|
///<param name="stateAttr">When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</param>
|
|
///<param name="stateValueTemplate">When defined, used as a template expression. For example "value + 10" will be internally interpreted as "{{ value + 10 }}" where 'value' is substituted with the value for 'attr_val' eg: value + 10</param>
|
|
///<param name="allowCreate">Allow state creation (given by state_id) if it does not exist</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="csvout">Filename of CSV to write the update state information to. Written to 'csv' directory. eg: ../web/mystatecsv.csv</param>
|
|
///<param name="csvlabel">Label to designate value written (in CSV file) eg: Updated from zha_toolkit.ha_set_state</param>
|
|
public Task<JsonElement?> HaSetStateAsync(string attrVal, string stateId, long? tries = null, string? stateAttr = null, string? stateValueTemplate = null, bool? allowCreate = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, string? csvout = null, string? csvlabel = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ha_set_state", null, new ZhaToolkitHaSetStateParameters { AttrVal = attrVal, Tries = tries, StateId = stateId, StateAttr = stateAttr, StateValueTemplate = stateValueTemplate, AllowCreate = allowCreate, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, Csvout = csvout, Csvlabel = csvlabel });
|
|
}
|
|
|
|
///<summary>Handle join (ZHA should re-interrogate the device as on new join)</summary>
|
|
public void HandleJoin(ZhaToolkitHandleJoinParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "handle_join", null, data);
|
|
}
|
|
|
|
///<summary>Handle join (ZHA should re-interrogate the device as on new join)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Short network address of the device (optional, if known in ZHA)</param>
|
|
public void HandleJoin(string ieee, long? commandData = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "handle_join", null, new ZhaToolkitHandleJoinParameters { Ieee = ieee, CommandData = commandData });
|
|
}
|
|
|
|
///<summary>Handle join (ZHA should re-interrogate the device as on new join)</summary>
|
|
public Task<JsonElement?> HandleJoinAsync(ZhaToolkitHandleJoinParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "handle_join", null, data);
|
|
}
|
|
|
|
///<summary>Handle join (ZHA should re-interrogate the device as on new join)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Short network address of the device (optional, if known in ZHA)</param>
|
|
public Task<JsonElement?> HandleJoinAsync(string ieee, long? commandData = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "handle_join", null, new ZhaToolkitHandleJoinParameters { Ieee = ieee, CommandData = commandData });
|
|
}
|
|
|
|
///<summary>Ping device</summary>
|
|
public void IeeePing(ZhaToolkitIeeePingParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ieee_ping", null, data);
|
|
}
|
|
|
|
///<summary>Ping device</summary>
|
|
///<param name="ieee">Ping: Requests IEEE address (using the known NWK Address) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void IeeePing(string ieee, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ieee_ping", null, new ZhaToolkitIeeePingParameters { Ieee = ieee, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Ping device</summary>
|
|
public Task<JsonElement?> IeeePingAsync(ZhaToolkitIeeePingParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ieee_ping", null, data);
|
|
}
|
|
|
|
///<summary>Ping device</summary>
|
|
///<param name="ieee">Ping: Requests IEEE address (using the known NWK Address) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> IeeePingAsync(string ieee, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ieee_ping", null, new ZhaToolkitIeeePingParameters { Ieee = ieee, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Send a Leave request to the device</summary>
|
|
public void Leave(ZhaToolkitLeaveParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "leave", null, data);
|
|
}
|
|
|
|
///<summary>Send a Leave request to the device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to leave the network eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void Leave(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "leave", null, new ZhaToolkitLeaveParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Send a Leave request to the device</summary>
|
|
public Task<JsonElement?> LeaveAsync(ZhaToolkitLeaveParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "leave", null, data);
|
|
}
|
|
|
|
///<summary>Send a Leave request to the device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to leave the network eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> LeaveAsync(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "leave", null, new ZhaToolkitLeaveParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Reinitialize device</summary>
|
|
public void MiscReinitialize(ZhaToolkitMiscReinitializeParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "misc_reinitialize", null, data);
|
|
}
|
|
|
|
///<summary>Reinitialize device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
public void MiscReinitialize(string ieee)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "misc_reinitialize", null, new ZhaToolkitMiscReinitializeParameters { Ieee = ieee });
|
|
}
|
|
|
|
///<summary>Reinitialize device</summary>
|
|
public Task<JsonElement?> MiscReinitializeAsync(ZhaToolkitMiscReinitializeParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "misc_reinitialize", null, data);
|
|
}
|
|
|
|
///<summary>Reinitialize device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
public Task<JsonElement?> MiscReinitializeAsync(string ieee)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "misc_reinitialize", null, new ZhaToolkitMiscReinitializeParameters { Ieee = ieee });
|
|
}
|
|
|
|
///<summary>Set Time Cluster attributes (Time, DST - except TimeStatus)</summary>
|
|
public void MiscSettime(ZhaToolkitMiscSettimeParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "misc_settime", null, data);
|
|
}
|
|
|
|
///<summary>Set Time Cluster attributes (Time, DST - except TimeStatus)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="readBeforeWrite">Read attributes before writing them</param>
|
|
///<param name="readAfterWrite">Read attribute after writing. Can be used to ensure the values match. Defaults to True</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
public void MiscSettime(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? readBeforeWrite = null, bool? readAfterWrite = null, string? csvout = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "misc_settime", null, new ZhaToolkitMiscSettimeParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ReadBeforeWrite = readBeforeWrite, ReadAfterWrite = readAfterWrite, Csvout = csvout });
|
|
}
|
|
|
|
///<summary>Set Time Cluster attributes (Time, DST - except TimeStatus)</summary>
|
|
public Task<JsonElement?> MiscSettimeAsync(ZhaToolkitMiscSettimeParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "misc_settime", null, data);
|
|
}
|
|
|
|
///<summary>Set Time Cluster attributes (Time, DST - except TimeStatus)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="readBeforeWrite">Read attributes before writing them</param>
|
|
///<param name="readAfterWrite">Read attribute after writing. Can be used to ensure the values match. Defaults to True</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</param>
|
|
public Task<JsonElement?> MiscSettimeAsync(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? readBeforeWrite = null, bool? readAfterWrite = null, string? csvout = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "misc_settime", null, new ZhaToolkitMiscSettimeParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ReadBeforeWrite = readBeforeWrite, ReadAfterWrite = readAfterWrite, Csvout = csvout });
|
|
}
|
|
|
|
///<summary>Notify a device that an update is available, after triggering ota image providers to fetch new images.</summary>
|
|
public void OtaNotify(ZhaToolkitOtaNotifyParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ota_notify", null, data);
|
|
}
|
|
|
|
///<summary>Notify a device that an update is available, after triggering ota image providers to fetch new images.</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: entity.name_of_zigbee_device</param>
|
|
///<param name="download">When True, download FW from KKoenk's list that possibly matches devices.</param>
|
|
///<param name="path">Path to write ota image(s) to (defaults to zha:zigpy_config:ota:otau_directory value or /config/zigpy_ota)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: ota_notify_success</param>
|
|
///<param name="eventFail">Event name in case of failure eg: ota_notify_fail</param>
|
|
///<param name="eventDone">Event name when the images were updated and the device notified (either success or failure). eg: ota_notify_done</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void OtaNotify(string ieee, bool? download = null, string? path = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "ota_notify", null, new ZhaToolkitOtaNotifyParameters { Ieee = ieee, Download = download, Path = path, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Notify a device that an update is available, after triggering ota image providers to fetch new images.</summary>
|
|
public Task<JsonElement?> OtaNotifyAsync(ZhaToolkitOtaNotifyParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ota_notify", null, data);
|
|
}
|
|
|
|
///<summary>Notify a device that an update is available, after triggering ota image providers to fetch new images.</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: entity.name_of_zigbee_device</param>
|
|
///<param name="download">When True, download FW from KKoenk's list that possibly matches devices.</param>
|
|
///<param name="path">Path to write ota image(s) to (defaults to zha:zigpy_config:ota:otau_directory value or /config/zigpy_ota)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: ota_notify_success</param>
|
|
///<param name="eventFail">Event name in case of failure eg: ota_notify_fail</param>
|
|
///<param name="eventDone">Event name when the images were updated and the device notified (either success or failure). eg: ota_notify_done</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> OtaNotifyAsync(string ieee, bool? download = null, string? path = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "ota_notify", null, new ZhaToolkitOtaNotifyParameters { Ieee = ieee, Download = download, Path = path, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Reregister zha-toolkit services Useful during development when they are updated in __init__.py</summary>
|
|
public void RegisterServices(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "register_services", null, data);
|
|
}
|
|
|
|
///<summary>Reregister zha-toolkit services Useful during development when they are updated in __init__.py</summary>
|
|
public Task<JsonElement?> RegisterServicesAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "register_services", null, data);
|
|
}
|
|
|
|
///<summary>Send a rejoin request to the device (=leave with rejoin)</summary>
|
|
public void Rejoin(ZhaToolkitRejoinParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "rejoin", null, data);
|
|
}
|
|
|
|
///<summary>Send a rejoin request to the device (=leave with rejoin)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to request rejoin eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Node used to accept the rejoin (Entity name, device name, or IEEE address of the node) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void Rejoin(string ieee, string? commandData = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "rejoin", null, new ZhaToolkitRejoinParameters { Ieee = ieee, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Send a rejoin request to the device (=leave with rejoin)</summary>
|
|
public Task<JsonElement?> RejoinAsync(ZhaToolkitRejoinParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "rejoin", null, data);
|
|
}
|
|
|
|
///<summary>Send a rejoin request to the device (=leave with rejoin)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to request rejoin eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Node used to accept the rejoin (Entity name, device name, or IEEE address of the node) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> RejoinAsync(string ieee, string? commandData = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "rejoin", null, new ZhaToolkitRejoinParameters { Ieee = ieee, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Remove all groups from (selected) endpoints on device</summary>
|
|
public void RemoveAllGroups(ZhaToolkitRemoveAllGroupsParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "remove_all_groups", null, data);
|
|
}
|
|
|
|
///<summary>Remove all groups from (selected) endpoints on device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (all endpoints when not set)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void RemoveAllGroups(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "remove_all_groups", null, new ZhaToolkitRemoveAllGroupsParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Remove all groups from (selected) endpoints on device</summary>
|
|
public Task<JsonElement?> RemoveAllGroupsAsync(ZhaToolkitRemoveAllGroupsParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "remove_all_groups", null, data);
|
|
}
|
|
|
|
///<summary>Remove all groups from (selected) endpoints on device</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (all endpoints when not set)</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> RemoveAllGroupsAsync(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "remove_all_groups", null, new ZhaToolkitRemoveAllGroupsParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Remove device endpoints from group</summary>
|
|
public void RemoveFromGroup(ZhaToolkitRemoveFromGroupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "remove_from_group", null, data);
|
|
}
|
|
|
|
///<summary>Remove device endpoints from group</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (or all EP if not set)</param>
|
|
///<param name="commandData">Group id to remove eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void RemoveFromGroup(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "remove_from_group", null, new ZhaToolkitRemoveFromGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Remove device endpoints from group</summary>
|
|
public Task<JsonElement?> RemoveFromGroupAsync(ZhaToolkitRemoveFromGroupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "remove_from_group", null, data);
|
|
}
|
|
|
|
///<summary>Remove device endpoints from group</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (or all EP if not set)</param>
|
|
///<param name="commandData">Group id to remove eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> RemoveFromGroupAsync(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "remove_from_group", null, new ZhaToolkitRemoveFromGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Remove group from endpoint groups list of device. May be equivalent to `remove_from_group`</summary>
|
|
public void RemoveGroup(ZhaToolkitRemoveGroupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "remove_group", null, data);
|
|
}
|
|
|
|
///<summary>Remove group from endpoint groups list of device. May be equivalent to `remove_from_group`</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (or all EP if not set)</param>
|
|
///<param name="commandData">Group id to remove eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void RemoveGroup(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "remove_group", null, new ZhaToolkitRemoveGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Remove group from endpoint groups list of device. May be equivalent to `remove_from_group`</summary>
|
|
public Task<JsonElement?> RemoveGroupAsync(ZhaToolkitRemoveGroupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "remove_group", null, data);
|
|
}
|
|
|
|
///<summary>Remove group from endpoint groups list of device. May be equivalent to `remove_from_group`</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">endpoint to remove group from (or all EP if not set)</param>
|
|
///<param name="commandData">Group id to remove eg: 2</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> RemoveGroupAsync(string ieee, long commandData, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "remove_group", null, new ZhaToolkitRemoveGroupParameters { Ieee = ieee, Endpoint = endpoint, CommandData = commandData, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Scan device (result written to file in /config/scans)</summary>
|
|
public void ScanDevice(ZhaToolkitScanDeviceParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "scan_device", null, data);
|
|
}
|
|
|
|
///<summary>Scan device (result written to file in /config/scans)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">Target endpoint, or list of endpoints eg: 1</param>
|
|
///<param name="tries">Number of times a zigbee packet is repeated when no response</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void ScanDevice(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "scan_device", null, new ZhaToolkitScanDeviceParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Scan device (result written to file in /config/scans)</summary>
|
|
public Task<JsonElement?> ScanDeviceAsync(ZhaToolkitScanDeviceParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "scan_device", null, data);
|
|
}
|
|
|
|
///<summary>Scan device (result written to file in /config/scans)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">Target endpoint, or list of endpoints eg: 1</param>
|
|
///<param name="tries">Number of times a zigbee packet is repeated when no response</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> ScanDeviceAsync(string ieee, long? endpoint = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "scan_device", null, new ZhaToolkitScanDeviceParameters { Ieee = ieee, Endpoint = endpoint, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Do Tuya magic spell (= make most Tuya devices work normally)</summary>
|
|
public void TuyaMagic(ZhaToolkitTuyaMagicParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "tuya_magic", null, data);
|
|
}
|
|
|
|
///<summary>Do Tuya magic spell (= make most Tuya devices work normally)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void TuyaMagic(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "tuya_magic", null, new ZhaToolkitTuyaMagicParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Do Tuya magic spell (= make most Tuya devices work normally)</summary>
|
|
public Task<JsonElement?> TuyaMagicAsync(ZhaToolkitTuyaMagicParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "tuya_magic", null, data);
|
|
}
|
|
|
|
///<summary>Do Tuya magic spell (= make most Tuya devices work normally)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> TuyaMagicAsync(string ieee, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "tuya_magic", null, new ZhaToolkitTuyaMagicParameters { Ieee = ieee, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device to the coordinator (your HA Instance)</summary>
|
|
public void UnbindCoordinator(ZhaToolkitUnbindCoordinatorParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "unbind_coordinator", null, data);
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device to the coordinator (your HA Instance)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">When provided, remove only bindings for this endpoint or list of endpoints (single value or list. Example: 20 or [20, 30]) Otherwise: removes bindings for all endpoints</param>
|
|
///<param name="cluster">When provided, remove only bindings for this cluster or list of clusters (single value or list. Example: 0x0200 or [0x200, 0x300]) Otherwise: removes bindings for all clusters</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void UnbindCoordinator(string ieee, long? endpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "unbind_coordinator", null, new ZhaToolkitUnbindCoordinatorParameters { Ieee = ieee, Endpoint = endpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device to the coordinator (your HA Instance)</summary>
|
|
public Task<JsonElement?> UnbindCoordinatorAsync(ZhaToolkitUnbindCoordinatorParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "unbind_coordinator", null, data);
|
|
}
|
|
|
|
///<summary>Remove (Unbind) all bindings from device to the coordinator (your HA Instance)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="endpoint">When provided, remove only bindings for this endpoint or list of endpoints (single value or list. Example: 20 or [20, 30]) Otherwise: removes bindings for all endpoints</param>
|
|
///<param name="cluster">When provided, remove only bindings for this cluster or list of clusters (single value or list. Example: 0x0200 or [0x200, 0x300]) Otherwise: removes bindings for all clusters</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> UnbindCoordinatorAsync(string ieee, long? endpoint = null, long? cluster = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "unbind_coordinator", null, new ZhaToolkitUnbindCoordinatorParameters { Ieee = ieee, Endpoint = endpoint, Cluster = cluster, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
public void UnbindGroup(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "unbind_group", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> UnbindGroupAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "unbind_group", null, data);
|
|
}
|
|
|
|
///<summary>Send cluster command</summary>
|
|
public void ZclCmd(ZhaToolkitZclCmdParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zcl_cmd", null, data);
|
|
}
|
|
|
|
///<summary>Send cluster command</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to send\ command to eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="cmd">Command Id to execute</param>
|
|
///<param name="args">Arguments for command when needed (as per zigpy's definition corresponding to Zigbee Library Cluster (ZCL) specification) eg: [1,"abcd",3]</param>
|
|
///<param name="kwargs">Keyword arguments for command eg: {"code":"cool_code"}</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void ZclCmd(string ieee, long cluster, long cmd, long? manf = null, long? endpoint = null, string? args = null, string? kwargs = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zcl_cmd", null, new ZhaToolkitZclCmdParameters { Ieee = ieee, Manf = manf, Endpoint = endpoint, Cluster = cluster, Cmd = cmd, Args = args, Kwargs = kwargs, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Send cluster command</summary>
|
|
public Task<JsonElement?> ZclCmdAsync(ZhaToolkitZclCmdParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zcl_cmd", null, data);
|
|
}
|
|
|
|
///<summary>Send cluster command</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to send\ command to eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="manf">Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</param>
|
|
///<param name="endpoint">target endpoint</param>
|
|
///<param name="cluster">target cluster</param>
|
|
///<param name="cmd">Command Id to execute</param>
|
|
///<param name="args">Arguments for command when needed (as per zigpy's definition corresponding to Zigbee Library Cluster (ZCL) specification) eg: [1,"abcd",3]</param>
|
|
///<param name="kwargs">Keyword arguments for command eg: {"code":"cool_code"}</param>
|
|
///<param name="tries">Number of times the zigbee packet should be attempted</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> ZclCmdAsync(string ieee, long cluster, long cmd, long? manf = null, long? endpoint = null, string? args = null, string? kwargs = null, long? tries = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zcl_cmd", null, new ZhaToolkitZclCmdParameters { Ieee = ieee, Manf = manf, Endpoint = endpoint, Cluster = cluster, Cmd = cmd, Args = args, Kwargs = kwargs, Tries = tries, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
public void ZdoFloodParentAnnce(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zdo_flood_parent_annce", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> ZdoFloodParentAnnceAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zdo_flood_parent_annce", null, data);
|
|
}
|
|
|
|
///<summary>Allow a device to join with a code (bellows radio type only)</summary>
|
|
public void ZdoJoinWithCode(ZhaToolkitZdoJoinWithCodeParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zdo_join_with_code", null, data);
|
|
}
|
|
|
|
///<summary>Allow a device to join with a code (bellows radio type only)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to request rejoin eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Node used to accept the rejoin (Entity name, device name, or IEEE address of the node) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="code">The code the device needs to present eg: 01234567</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void ZdoJoinWithCode(string ieee, string code, string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zdo_join_with_code", null, new ZhaToolkitZdoJoinWithCodeParameters { Ieee = ieee, CommandData = commandData, Code = code, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Allow a device to join with a code (bellows radio type only)</summary>
|
|
public Task<JsonElement?> ZdoJoinWithCodeAsync(ZhaToolkitZdoJoinWithCodeParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zdo_join_with_code", null, data);
|
|
}
|
|
|
|
///<summary>Allow a device to join with a code (bellows radio type only)</summary>
|
|
///<param name="ieee">Entity name, device name, or IEEE address of the node to request rejoin eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Node used to accept the rejoin (Entity name, device name, or IEEE address of the node) eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="code">The code the device needs to present eg: 01234567</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> ZdoJoinWithCodeAsync(string ieee, string code, string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zdo_join_with_code", null, new ZhaToolkitZdoJoinWithCodeParameters { Ieee = ieee, CommandData = commandData, Code = code, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
public void ZdoScanNow(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zdo_scan_now", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> ZdoScanNowAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zdo_scan_now", null, data);
|
|
}
|
|
|
|
public void ZdoUpdateNwkId(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zdo_update_nwk_id", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> ZdoUpdateNwkIdAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zdo_update_nwk_id", null, data);
|
|
}
|
|
|
|
///<summary>Export device information (Response, CSV File, JSON File, Event)</summary>
|
|
public void ZhaDevices(ZhaToolkitZhaDevicesParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zha_devices", null, data);
|
|
}
|
|
|
|
///<summary>Export device information (Response, CSV File, JSON File, Event)</summary>
|
|
///<param name="ieee">Optional Entity name, device name, or IEEE address of the device to provide details for. Defaults to all devices eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Selected Fields eg: ["ieee","lqi","name"]</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory (can be relative as in example). eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Column to sort table by eg: lqi</param>
|
|
///<param name="jsonOut">Filename of JSON to write read data to. Written to '/config/json' directory eg: zha_devices.json</param>
|
|
///<param name="jsonTimestamp">Add timestamp to Filename of JSON file. Defaults to False. eg: True</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public void ZhaDevices(string? ieee = null, string? commandData = null, string? csvout = null, object? csvlabel = null, string? jsonOut = null, bool? jsonTimestamp = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "zha_devices", null, new ZhaToolkitZhaDevicesParameters { Ieee = ieee, CommandData = commandData, Csvout = csvout, Csvlabel = csvlabel, JsonOut = jsonOut, JsonTimestamp = jsonTimestamp, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Export device information (Response, CSV File, JSON File, Event)</summary>
|
|
public Task<JsonElement?> ZhaDevicesAsync(ZhaToolkitZhaDevicesParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zha_devices", null, data);
|
|
}
|
|
|
|
///<summary>Export device information (Response, CSV File, JSON File, Event)</summary>
|
|
///<param name="ieee">Optional Entity name, device name, or IEEE address of the device to provide details for. Defaults to all devices eg: 00:0d:6f:00:05:7d:2d:34</param>
|
|
///<param name="commandData">Selected Fields eg: ["ieee","lqi","name"]</param>
|
|
///<param name="csvout">Filename of CSV to write read data to. Written to 'csv' directory (can be relative as in example). eg: ../web/mycsv.csv</param>
|
|
///<param name="csvlabel">Column to sort table by eg: lqi</param>
|
|
///<param name="jsonOut">Filename of JSON to write read data to. Written to '/config/json' directory eg: zha_devices.json</param>
|
|
///<param name="jsonTimestamp">Add timestamp to Filename of JSON file. Defaults to False. eg: True</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
public Task<JsonElement?> ZhaDevicesAsync(string? ieee = null, string? commandData = null, string? csvout = null, object? csvlabel = null, string? jsonOut = null, bool? jsonTimestamp = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "zha_devices", null, new ZhaToolkitZhaDevicesParameters { Ieee = ieee, CommandData = commandData, Csvout = csvout, Csvlabel = csvlabel, JsonOut = jsonOut, JsonTimestamp = jsonTimestamp, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException });
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
public void ZnpBackup(ZhaToolkitZnpBackupParameters data)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "znp_backup", null, data);
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
///<param name="commandData">Suffix for backup file eg: _bathroom_added</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public void ZnpBackup(string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "znp_backup", null, new ZhaToolkitZnpBackupParameters { CommandData = commandData, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
public Task<JsonElement?> ZnpBackupAsync(ZhaToolkitZnpBackupParameters data)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "znp_backup", null, data);
|
|
}
|
|
|
|
///<summary>Backup coordinator data (znp, bellows/ezsp)</summary>
|
|
///<param name="commandData">Suffix for backup file eg: _bathroom_added</param>
|
|
///<param name="eventSuccess">Event name in case of success eg: my_read_success_trigger_event</param>
|
|
///<param name="eventFail">Event name in case of failure eg: my_read_fail_trigger_event</param>
|
|
///<param name="eventDone">Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</param>
|
|
///<param name="failException">Throw exception when success==False, useful to stop scripts, automations</param>
|
|
///<param name="expectReply">Wait for/expect a reply (not used yet)</param>
|
|
public Task<JsonElement?> ZnpBackupAsync(string? commandData = null, string? eventSuccess = null, string? eventFail = null, string? eventDone = null, bool? failException = null, bool? expectReply = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "znp_backup", null, new ZhaToolkitZnpBackupParameters { CommandData = commandData, EventSuccess = eventSuccess, EventFail = eventFail, EventDone = eventDone, FailException = failException, ExpectReply = expectReply });
|
|
}
|
|
|
|
public void ZnpNvramBackup(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "znp_nvram_backup", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> ZnpNvramBackupAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "znp_nvram_backup", null, data);
|
|
}
|
|
|
|
public void ZnpNvramReset(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "znp_nvram_reset", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> ZnpNvramResetAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "znp_nvram_reset", null, data);
|
|
}
|
|
|
|
public void ZnpNvramRestore(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "znp_nvram_restore", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> ZnpNvramRestoreAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "znp_nvram_restore", null, data);
|
|
}
|
|
|
|
public void ZnpRestore(object? data = null)
|
|
{
|
|
_haContext.CallService("zha_toolkit", "znp_restore", null, data);
|
|
}
|
|
|
|
public Task<JsonElement?> ZnpRestoreAsync(object? data = null)
|
|
{
|
|
return _haContext.CallServiceWithResponseAsync("zha_toolkit", "znp_restore", null, data);
|
|
}
|
|
}
|
|
|
|
public partial record ZhaToolkitAddGroupParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>endpoint to get information for (all endpoints when not set)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Group id to add eg: 2</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public long? CommandData { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitAddToGroupParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>endpoint to remove group from (or all EP if not set)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Group id to remove eg: 2</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public long? CommandData { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitAllRoutesAndNeighboursParameters
|
|
{
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitAttrReadParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</summary>
|
|
[JsonPropertyName("manf")]
|
|
public long? Manf { get; init; }
|
|
|
|
///<summary>target endpoint</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>target cluster</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>target attribute id (or name, accepted in most cases)</summary>
|
|
[JsonPropertyName("attribute")]
|
|
public long? Attribute { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>When defined, name of state to write the read attribute value to eg: sensor.example</summary>
|
|
[JsonPropertyName("state_id")]
|
|
public string? StateId { get; init; }
|
|
|
|
///<summary>When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</summary>
|
|
[JsonPropertyName("state_attr")]
|
|
public string? StateAttr { get; init; }
|
|
|
|
///<summary>When defined, the read attribute is converted using this template before writing it to the state. eg: value / 100</summary>
|
|
[JsonPropertyName("state_value_template")]
|
|
public string? StateValueTemplate { get; init; }
|
|
|
|
///<summary>Force an update event when the state is written When not set or false, if the state value is unchanged, the update may not trigger an automation. eg: True</summary>
|
|
[JsonPropertyName("force_update")]
|
|
public bool? ForceUpdate { get; init; }
|
|
|
|
///<summary>Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning where it falls back to an actual read when the value is not in cache. eg: True</summary>
|
|
[JsonPropertyName("use_cache")]
|
|
public bool? UseCache { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Allow state creation (given by state_id) if it does not exist</summary>
|
|
[JsonPropertyName("allow_create")]
|
|
public bool? AllowCreate { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
|
|
///<summary>Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</summary>
|
|
[JsonPropertyName("csvout")]
|
|
public string? Csvout { get; init; }
|
|
|
|
///<summary>Label to use for read value (in CSV file) eg: SecretAttributeName</summary>
|
|
[JsonPropertyName("csvlabel")]
|
|
public string? Csvlabel { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitAttrWriteParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</summary>
|
|
[JsonPropertyName("manf")]
|
|
public long? Manf { get; init; }
|
|
|
|
///<summary>target endpoint</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>target cluster</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>target attribute id (or name, accepted in most cases)</summary>
|
|
[JsonPropertyName("attribute")]
|
|
public long? Attribute { get; init; }
|
|
|
|
///<summary>Attribute type (to write, ...)</summary>
|
|
[JsonPropertyName("attr_type")]
|
|
public long? AttrType { get; init; }
|
|
|
|
///<summary>Attribute value to write</summary>
|
|
[JsonPropertyName("attr_val")]
|
|
public string? AttrVal { get; init; }
|
|
|
|
///<summary>Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning where it falls back to an actual read (when reading before a write) when the value is not in cache. eg: True</summary>
|
|
[JsonPropertyName("use_cache")]
|
|
public bool? UseCache { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>When defined, name of state to write the read attribute value to eg: sensor.example</summary>
|
|
[JsonPropertyName("state_id")]
|
|
public string? StateId { get; init; }
|
|
|
|
///<summary>When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</summary>
|
|
[JsonPropertyName("state_attr")]
|
|
public string? StateAttr { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Allow state creation (given by state_id) if it does not exist</summary>
|
|
[JsonPropertyName("allow_create")]
|
|
public bool? AllowCreate { get; init; }
|
|
|
|
///<summary>Read attribute before writing it (used with attr_write). When the read value matches the value to write, no write is done. Defaults to True.</summary>
|
|
[JsonPropertyName("read_before_write")]
|
|
public bool? ReadBeforeWrite { get; init; }
|
|
|
|
///<summary>Read attribute after writing. Can be used to ensure the values match. Defaults to True</summary>
|
|
[JsonPropertyName("read_after_write")]
|
|
public bool? ReadAfterWrite { get; init; }
|
|
|
|
///<summary>Force writing the attribute even if the read attribute already matches. Defaults to False</summary>
|
|
[JsonPropertyName("write_if_equal")]
|
|
public bool? WriteIfEqual { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
|
|
///<summary>Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</summary>
|
|
[JsonPropertyName("csvout")]
|
|
public string? Csvout { get; init; }
|
|
|
|
///<summary>Label to use for read value (in CSV file) eg: SecretAttributeName</summary>
|
|
[JsonPropertyName("csvlabel")]
|
|
public string? Csvlabel { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitBackupParameters
|
|
{
|
|
///<summary>Suffix for backup file eg: _bathroom_added</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitBindGroupParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Target group for binding eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public long? CommandData { get; init; }
|
|
|
|
///<summary>Target endpoint (when missing: all endpoints)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Target cluster (when missing: all internally defined cluster)</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitBindIeeeParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Binding target (Entity name, device name, or IEEE address of the node to execute command). By default: coordinator eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>Target endpoint (when missing: all endpoints)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Destination endpoint (when missing: first EP with matching cluster)</summary>
|
|
[JsonPropertyName("dst_endpoint")]
|
|
public long? DstEndpoint { get; init; }
|
|
|
|
///<summary>Target cluster (or all internally defined ones)</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitBindsGetParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitBindsRemoveAllParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>When provided, remove only bindings towards this device (Entity name, device name, or IEEE address of the binding destination) eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>When provided, remove only bindings for this endpoint or list of endpoints (single value or list. Example: 20 or [20, 30]) Otherwise: removes bindings for all endpoints</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>When provided, remove only bindings for this cluster or list of clusters (single value or list. Example: 0x0200 or [0x200, 0x300]) Otherwise: removes bindings for all clusters</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitConfReportParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>target endpoint</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>target cluster</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>target attribute id (or name, accepted in most cases)</summary>
|
|
[JsonPropertyName("attribute")]
|
|
public long? Attribute { get; init; }
|
|
|
|
///<summary>Minimum report interval (seconds)</summary>
|
|
[JsonPropertyName("min_interval")]
|
|
public long? MinInterval { get; init; }
|
|
|
|
///<summary>Maximum report interval (seconds)</summary>
|
|
[JsonPropertyName("max_interval")]
|
|
public long? MaxInterval { get; init; }
|
|
|
|
///<summary>Minimum change before reporting</summary>
|
|
[JsonPropertyName("reportable_change")]
|
|
public long? ReportableChange { get; init; }
|
|
|
|
///<summary>Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</summary>
|
|
[JsonPropertyName("manf")]
|
|
public long? Manf { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitConfReportReadParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>target endpoint</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>target cluster</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>target attribute id (or name, accepted in most cases), can be a list</summary>
|
|
[JsonPropertyName("attribute")]
|
|
public long? Attribute { get; init; }
|
|
|
|
///<summary>Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</summary>
|
|
[JsonPropertyName("manf")]
|
|
public long? Manf { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitExecuteParameters
|
|
{
|
|
///<summary>Command name eg: scan_device</summary>
|
|
[JsonPropertyName("command")]
|
|
public object? Command { get; init; }
|
|
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>data for the command (specific command. Example, second IEEE address for binding) eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</summary>
|
|
[JsonPropertyName("manf")]
|
|
public long? Manf { get; init; }
|
|
|
|
///<summary>Command Id (zcl_cmd)</summary>
|
|
[JsonPropertyName("cmd")]
|
|
public long? Cmd { get; init; }
|
|
|
|
///<summary>target endpoint</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>destination endpoint</summary>
|
|
[JsonPropertyName("dst_endpoint")]
|
|
public long? DstEndpoint { get; init; }
|
|
|
|
///<summary>target cluster</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>target attribute id (or name, accepted in most cases)</summary>
|
|
[JsonPropertyName("attribute")]
|
|
public long? Attribute { get; init; }
|
|
|
|
///<summary>Attribute type (to write, ...)</summary>
|
|
[JsonPropertyName("attr_type")]
|
|
public long? AttrType { get; init; }
|
|
|
|
///<summary>Attribute value to write</summary>
|
|
[JsonPropertyName("attr_val")]
|
|
public string? AttrVal { get; init; }
|
|
|
|
///<summary>Minimum report interval (seconds)</summary>
|
|
[JsonPropertyName("min_interval")]
|
|
public long? MinInterval { get; init; }
|
|
|
|
///<summary>Maximum report interval (seconds)</summary>
|
|
[JsonPropertyName("max_interval")]
|
|
public long? MaxInterval { get; init; }
|
|
|
|
///<summary>Minimum change before reporting</summary>
|
|
[JsonPropertyName("reportable_change")]
|
|
public long? ReportableChange { get; init; }
|
|
|
|
///<summary>Direction indicator, according to command</summary>
|
|
[JsonPropertyName("dir")]
|
|
public long? Dir { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>When defined, name of state to write the read attribute value to eg: sensor.example</summary>
|
|
[JsonPropertyName("state_id")]
|
|
public string? StateId { get; init; }
|
|
|
|
///<summary>When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</summary>
|
|
[JsonPropertyName("state_attr")]
|
|
public string? StateAttr { get; init; }
|
|
|
|
///<summary>When defined, the read attribute is converted using this template before writing it to the state. eg: value / 100</summary>
|
|
[JsonPropertyName("state_value_template")]
|
|
public string? StateValueTemplate { get; init; }
|
|
|
|
///<summary>Force an update event when the state is written When not set or false, if the state value is unchanged, the update may not trigger an automation. eg: True</summary>
|
|
[JsonPropertyName("force_update")]
|
|
public bool? ForceUpdate { get; init; }
|
|
|
|
///<summary>Use zigpy attribute cache to get the value of an attribute. (Does not send a zigbee packet to read the attribute). Can also be 0, 1 or 2, where 2 has a special meaning with attr_write where it falls back to an actual read when the value is not in cache. eg: True</summary>
|
|
[JsonPropertyName("use_cache")]
|
|
public bool? UseCache { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Allow state creation (given by state_id) if it does not exist</summary>
|
|
[JsonPropertyName("allow_create")]
|
|
public bool? AllowCreate { get; init; }
|
|
|
|
///<summary>Read attribute before writing it (used with attr_write). When the read value matches the value to write, no write is done. Defaults to True.</summary>
|
|
[JsonPropertyName("read_before_write")]
|
|
public bool? ReadBeforeWrite { get; init; }
|
|
|
|
///<summary>Read attribute after writing. Can be used to ensure the values match. Defaults to True</summary>
|
|
[JsonPropertyName("read_after_write")]
|
|
public bool? ReadAfterWrite { get; init; }
|
|
|
|
///<summary>Force writing the attribute even if the read attribute already matches. Defaults to False</summary>
|
|
[JsonPropertyName("write_if_equal")]
|
|
public bool? WriteIfEqual { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
|
|
///<summary>Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</summary>
|
|
[JsonPropertyName("csvout")]
|
|
public string? Csvout { get; init; }
|
|
|
|
///<summary>Label to use for read value (in CSV file) eg: SecretAttributeName</summary>
|
|
[JsonPropertyName("csvlabel")]
|
|
public string? Csvlabel { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitEzspBackupParameters
|
|
{
|
|
///<summary>Suffix for backup file eg: _bathroom_added</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitGetGroupsParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>endpoint to get information for (all endpoints when not set)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitGetRoutesAndNeighboursParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitGetZllGroupsParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitHaSetStateParameters
|
|
{
|
|
///<summary>value to write to the state (or use in the template)</summary>
|
|
[JsonPropertyName("attr_val")]
|
|
public string? AttrVal { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Name of state to write the read attribute value to eg: sensor.example</summary>
|
|
[JsonPropertyName("state_id")]
|
|
public string? StateId { get; init; }
|
|
|
|
///<summary>When defined, attribute in state_id to write the read attribute value to. Write to state value when missing (and state_id is defined) eg: other_attr</summary>
|
|
[JsonPropertyName("state_attr")]
|
|
public string? StateAttr { get; init; }
|
|
|
|
///<summary>When defined, used as a template expression. For example "value + 10" will be internally interpreted as "{{ value + 10 }}" where 'value' is substituted with the value for 'attr_val' eg: value + 10</summary>
|
|
[JsonPropertyName("state_value_template")]
|
|
public string? StateValueTemplate { get; init; }
|
|
|
|
///<summary>Allow state creation (given by state_id) if it does not exist</summary>
|
|
[JsonPropertyName("allow_create")]
|
|
public bool? AllowCreate { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Filename of CSV to write the update state information to. Written to 'csv' directory. eg: ../web/mystatecsv.csv</summary>
|
|
[JsonPropertyName("csvout")]
|
|
public string? Csvout { get; init; }
|
|
|
|
///<summary>Label to designate value written (in CSV file) eg: Updated from zha_toolkit.ha_set_state</summary>
|
|
[JsonPropertyName("csvlabel")]
|
|
public string? Csvlabel { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitHandleJoinParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Short network address of the device (optional, if known in ZHA)</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public long? CommandData { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitIeeePingParameters
|
|
{
|
|
///<summary>Ping: Requests IEEE address (using the known NWK Address) eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitLeaveParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to leave the network eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitMiscReinitializeParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command" eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitMiscSettimeParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>target endpoint</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Read attributes before writing them</summary>
|
|
[JsonPropertyName("read_before_write")]
|
|
public bool? ReadBeforeWrite { get; init; }
|
|
|
|
///<summary>Read attribute after writing. Can be used to ensure the values match. Defaults to True</summary>
|
|
[JsonPropertyName("read_after_write")]
|
|
public bool? ReadAfterWrite { get; init; }
|
|
|
|
///<summary>Filename of CSV to write read data to. Written to 'csv' directory eg: ../web/mycsv.csv</summary>
|
|
[JsonPropertyName("csvout")]
|
|
public string? Csvout { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitOtaNotifyParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: entity.name_of_zigbee_device</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>When True, download FW from KKoenk's list that possibly matches devices.</summary>
|
|
[JsonPropertyName("download")]
|
|
public bool? Download { get; init; }
|
|
|
|
///<summary>Path to write ota image(s) to (defaults to zha:zigpy_config:ota:otau_directory value or /config/zigpy_ota)</summary>
|
|
[JsonPropertyName("path")]
|
|
public string? Path { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: ota_notify_success</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: ota_notify_fail</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the images were updated and the device notified (either success or failure). eg: ota_notify_done</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitRejoinParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to request rejoin eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Node used to accept the rejoin (Entity name, device name, or IEEE address of the node) eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitRemoveAllGroupsParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>endpoint to remove group from (all endpoints when not set)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitRemoveFromGroupParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>endpoint to remove group from (or all EP if not set)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Group id to remove eg: 2</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public long? CommandData { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitRemoveGroupParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>endpoint to remove group from (or all EP if not set)</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Group id to remove eg: 2</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public long? CommandData { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitScanDeviceParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Target endpoint, or list of endpoints eg: 1</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>Number of times a zigbee packet is repeated when no response</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitTuyaMagicParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitUnbindCoordinatorParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to execute command eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>When provided, remove only bindings for this endpoint or list of endpoints (single value or list. Example: 20 or [20, 30]) Otherwise: removes bindings for all endpoints</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>When provided, remove only bindings for this cluster or list of clusters (single value or list. Example: 0x0200 or [0x200, 0x300]) Otherwise: removes bindings for all clusters</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitZclCmdParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to send\ command to eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Manufacturer id (0 = No manufacturer id, empty=possibly automatic)</summary>
|
|
[JsonPropertyName("manf")]
|
|
public long? Manf { get; init; }
|
|
|
|
///<summary>target endpoint</summary>
|
|
[JsonPropertyName("endpoint")]
|
|
public long? Endpoint { get; init; }
|
|
|
|
///<summary>target cluster</summary>
|
|
[JsonPropertyName("cluster")]
|
|
public long? Cluster { get; init; }
|
|
|
|
///<summary>Command Id to execute</summary>
|
|
[JsonPropertyName("cmd")]
|
|
public long? Cmd { get; init; }
|
|
|
|
///<summary>Arguments for command when needed (as per zigpy's definition corresponding to Zigbee Library Cluster (ZCL) specification) eg: [1,"abcd",3]</summary>
|
|
[JsonPropertyName("args")]
|
|
public string? Args { get; init; }
|
|
|
|
///<summary>Keyword arguments for command eg: {"code":"cool_code"}</summary>
|
|
[JsonPropertyName("kwargs")]
|
|
public string? Kwargs { get; init; }
|
|
|
|
///<summary>Number of times the zigbee packet should be attempted</summary>
|
|
[JsonPropertyName("tries")]
|
|
public long? Tries { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitZdoJoinWithCodeParameters
|
|
{
|
|
///<summary>Entity name, device name, or IEEE address of the node to request rejoin eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Node used to accept the rejoin (Entity name, device name, or IEEE address of the node) eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>The code the device needs to present eg: 01234567</summary>
|
|
[JsonPropertyName("code")]
|
|
public string? Code { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitZhaDevicesParameters
|
|
{
|
|
///<summary>Optional Entity name, device name, or IEEE address of the device to provide details for. Defaults to all devices eg: 00:0d:6f:00:05:7d:2d:34</summary>
|
|
[JsonPropertyName("ieee")]
|
|
public string? Ieee { get; init; }
|
|
|
|
///<summary>Selected Fields eg: ["ieee","lqi","name"]</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>Filename of CSV to write read data to. Written to 'csv' directory (can be relative as in example). eg: ../web/mycsv.csv</summary>
|
|
[JsonPropertyName("csvout")]
|
|
public string? Csvout { get; init; }
|
|
|
|
///<summary>Column to sort table by eg: lqi</summary>
|
|
[JsonPropertyName("csvlabel")]
|
|
public object? Csvlabel { get; init; }
|
|
|
|
///<summary>Filename of JSON to write read data to. Written to '/config/json' directory eg: zha_devices.json</summary>
|
|
[JsonPropertyName("json_out")]
|
|
public string? JsonOut { get; init; }
|
|
|
|
///<summary>Add timestamp to Filename of JSON file. Defaults to False. eg: True</summary>
|
|
[JsonPropertyName("json_timestamp")]
|
|
public bool? JsonTimestamp { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
}
|
|
|
|
public partial record ZhaToolkitZnpBackupParameters
|
|
{
|
|
///<summary>Suffix for backup file eg: _bathroom_added</summary>
|
|
[JsonPropertyName("command_data")]
|
|
public string? CommandData { get; init; }
|
|
|
|
///<summary>Event name in case of success eg: my_read_success_trigger_event</summary>
|
|
[JsonPropertyName("event_success")]
|
|
public string? EventSuccess { get; init; }
|
|
|
|
///<summary>Event name in case of failure eg: my_read_fail_trigger_event</summary>
|
|
[JsonPropertyName("event_fail")]
|
|
public string? EventFail { get; init; }
|
|
|
|
///<summary>Event name when the service call did all its work (either success or failure). Has event data with relevant attributes. eg: my_read_done_trigger_event</summary>
|
|
[JsonPropertyName("event_done")]
|
|
public string? EventDone { get; init; }
|
|
|
|
///<summary>Throw exception when success==False, useful to stop scripts, automations</summary>
|
|
[JsonPropertyName("fail_exception")]
|
|
public bool? FailException { get; init; }
|
|
|
|
///<summary>Wait for/expect a reply (not used yet)</summary>
|
|
[JsonPropertyName("expect_reply")]
|
|
public bool? ExpectReply { get; init; }
|
|
}
|
|
|
|
public partial class ZoneServices
|
|
{
|
|
private readonly IHaContext _haContext;
|
|
public ZoneServices(IHaContext haContext)
|
|
{
|
|
_haContext = haContext;
|
|
}
|
|
|
|
///<summary>Create a new zone in Home Assistant on the fly.</summary>
|
|
public void Create(ZoneCreateParameters data)
|
|
{
|
|
_haContext.CallService("zone", "create", null, data);
|
|
}
|
|
|
|
///<summary>Create a new zone in Home Assistant on the fly.</summary>
|
|
///<param name="name">Name of the zone</param>
|
|
///<param name="icon">Icon to use for the zone</param>
|
|
///<param name="latitude">Latitude of the zone</param>
|
|
///<param name="longitude">Longitude of the zone</param>
|
|
///<param name="radius">Radius of the zone</param>
|
|
public void Create(string name, double latitude, double longitude, object? icon = null, long? radius = null)
|
|
{
|
|
_haContext.CallService("zone", "create", null, new ZoneCreateParameters { Name = name, Icon = icon, Latitude = latitude, Longitude = longitude, Radius = radius });
|
|
}
|
|
|
|
///<summary>Delete a zone. This works only with zones created and managed via the UI. Zones created and managed in YAML cannot be managed by Spook.</summary>
|
|
public void Delete(ZoneDeleteParameters data)
|
|
{
|
|
_haContext.CallService("zone", "delete", null, data);
|
|
}
|
|
|
|
///<summary>Delete a zone. This works only with zones created and managed via the UI. Zones created and managed in YAML cannot be managed by Spook.</summary>
|
|
///<param name="entityId">The ID of the entity (or entities) to remove.</param>
|
|
public void Delete(IEnumerable<string> entityId)
|
|
{
|
|
_haContext.CallService("zone", "delete", null, new ZoneDeleteParameters { EntityId = entityId });
|
|
}
|
|
|
|
public void Reload(object? data = null)
|
|
{
|
|
_haContext.CallService("zone", "reload", null, data);
|
|
}
|
|
|
|
///<summary>Update properties of a zone on the fly.</summary>
|
|
public void Update(ZoneUpdateParameters data)
|
|
{
|
|
_haContext.CallService("zone", "update", null, data);
|
|
}
|
|
|
|
///<summary>Update properties of a zone on the fly.</summary>
|
|
///<param name="entityId">The ID of the entity (or entities) to update.</param>
|
|
///<param name="name">Name of the zone</param>
|
|
///<param name="icon">Icon to use for the zone</param>
|
|
///<param name="latitude">Latitude of the zone</param>
|
|
///<param name="longitude">Longitude of the zone</param>
|
|
///<param name="radius">Radius of the zone</param>
|
|
public void Update(string entityId, string? name = null, object? icon = null, double? latitude = null, double? longitude = null, double? radius = null)
|
|
{
|
|
_haContext.CallService("zone", "update", null, new ZoneUpdateParameters { EntityId = entityId, Name = name, Icon = icon, Latitude = latitude, Longitude = longitude, Radius = radius });
|
|
}
|
|
}
|
|
|
|
public partial record ZoneCreateParameters
|
|
{
|
|
///<summary>Name of the zone</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary>Icon to use for the zone</summary>
|
|
[JsonPropertyName("icon")]
|
|
public object? Icon { get; init; }
|
|
|
|
///<summary>Latitude of the zone</summary>
|
|
[JsonPropertyName("latitude")]
|
|
public double? Latitude { get; init; }
|
|
|
|
///<summary>Longitude of the zone</summary>
|
|
[JsonPropertyName("longitude")]
|
|
public double? Longitude { get; init; }
|
|
|
|
///<summary>Radius of the zone</summary>
|
|
[JsonPropertyName("radius")]
|
|
public long? Radius { get; init; }
|
|
}
|
|
|
|
public partial record ZoneDeleteParameters
|
|
{
|
|
///<summary>The ID of the entity (or entities) to remove.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public IEnumerable<string>? EntityId { get; init; }
|
|
}
|
|
|
|
public partial record ZoneUpdateParameters
|
|
{
|
|
///<summary>The ID of the entity (or entities) to update.</summary>
|
|
[JsonPropertyName("entity_id")]
|
|
public string? EntityId { get; init; }
|
|
|
|
///<summary>Name of the zone</summary>
|
|
[JsonPropertyName("name")]
|
|
public string? Name { get; init; }
|
|
|
|
///<summary>Icon to use for the zone</summary>
|
|
[JsonPropertyName("icon")]
|
|
public object? Icon { get; init; }
|
|
|
|
///<summary>Latitude of the zone</summary>
|
|
[JsonPropertyName("latitude")]
|
|
public double? Latitude { get; init; }
|
|
|
|
///<summary>Longitude of the zone</summary>
|
|
[JsonPropertyName("longitude")]
|
|
public double? Longitude { get; init; }
|
|
|
|
///<summary>Radius of the zone</summary>
|
|
[JsonPropertyName("radius")]
|
|
public double? Radius { get; init; }
|
|
}
|
|
|
|
public static class AutomationEntityExtensionMethods
|
|
{
|
|
public static void Toggle(this IAutomationEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<IAutomationEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Trigger(this IAutomationEntityCore target, AutomationTriggerParameters data)
|
|
{
|
|
target.CallService("trigger", data);
|
|
}
|
|
|
|
public static void Trigger(this IEnumerable<IAutomationEntityCore> target, AutomationTriggerParameters data)
|
|
{
|
|
target.CallService("trigger", data);
|
|
}
|
|
|
|
///<param name="target">The IAutomationEntityCore to call this service for</param>
|
|
///<param name="skipCondition"></param>
|
|
public static void Trigger(this IAutomationEntityCore target, bool? skipCondition = null)
|
|
{
|
|
target.CallService("trigger", new AutomationTriggerParameters { SkipCondition = skipCondition });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IAutomationEntityCore> to call this service for</param>
|
|
///<param name="skipCondition"></param>
|
|
public static void Trigger(this IEnumerable<IAutomationEntityCore> target, bool? skipCondition = null)
|
|
{
|
|
target.CallService("trigger", new AutomationTriggerParameters { SkipCondition = skipCondition });
|
|
}
|
|
|
|
public static void TurnOff(this IAutomationEntityCore target, AutomationTurnOffParameters data)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<IAutomationEntityCore> target, AutomationTurnOffParameters data)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
///<param name="target">The IAutomationEntityCore to call this service for</param>
|
|
///<param name="stopActions"></param>
|
|
public static void TurnOff(this IAutomationEntityCore target, bool? stopActions = null)
|
|
{
|
|
target.CallService("turn_off", new AutomationTurnOffParameters { StopActions = stopActions });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IAutomationEntityCore> to call this service for</param>
|
|
///<param name="stopActions"></param>
|
|
public static void TurnOff(this IEnumerable<IAutomationEntityCore> target, bool? stopActions = null)
|
|
{
|
|
target.CallService("turn_off", new AutomationTurnOffParameters { StopActions = stopActions });
|
|
}
|
|
|
|
public static void TurnOn(this IAutomationEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<IAutomationEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
}
|
|
|
|
public static class ButtonEntityExtensionMethods
|
|
{
|
|
public static void Press(this IButtonEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("press", data);
|
|
}
|
|
|
|
public static void Press(this IEnumerable<IButtonEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("press", data);
|
|
}
|
|
}
|
|
|
|
public static class ClimateEntityExtensionMethods
|
|
{
|
|
public static void SetFanMode(this IClimateEntityCore target, ClimateSetFanModeParameters data)
|
|
{
|
|
target.CallService("set_fan_mode", data);
|
|
}
|
|
|
|
public static void SetFanMode(this IEnumerable<IClimateEntityCore> target, ClimateSetFanModeParameters data)
|
|
{
|
|
target.CallService("set_fan_mode", data);
|
|
}
|
|
|
|
///<param name="target">The IClimateEntityCore to call this service for</param>
|
|
///<param name="fanMode"> eg: low</param>
|
|
public static void SetFanMode(this IClimateEntityCore target, string fanMode)
|
|
{
|
|
target.CallService("set_fan_mode", new ClimateSetFanModeParameters { FanMode = fanMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IClimateEntityCore> to call this service for</param>
|
|
///<param name="fanMode"> eg: low</param>
|
|
public static void SetFanMode(this IEnumerable<IClimateEntityCore> target, string fanMode)
|
|
{
|
|
target.CallService("set_fan_mode", new ClimateSetFanModeParameters { FanMode = fanMode });
|
|
}
|
|
|
|
public static void SetHumidity(this IClimateEntityCore target, ClimateSetHumidityParameters data)
|
|
{
|
|
target.CallService("set_humidity", data);
|
|
}
|
|
|
|
public static void SetHumidity(this IEnumerable<IClimateEntityCore> target, ClimateSetHumidityParameters data)
|
|
{
|
|
target.CallService("set_humidity", data);
|
|
}
|
|
|
|
///<param name="target">The IClimateEntityCore to call this service for</param>
|
|
///<param name="humidity"></param>
|
|
public static void SetHumidity(this IClimateEntityCore target, long humidity)
|
|
{
|
|
target.CallService("set_humidity", new ClimateSetHumidityParameters { Humidity = humidity });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IClimateEntityCore> to call this service for</param>
|
|
///<param name="humidity"></param>
|
|
public static void SetHumidity(this IEnumerable<IClimateEntityCore> target, long humidity)
|
|
{
|
|
target.CallService("set_humidity", new ClimateSetHumidityParameters { Humidity = humidity });
|
|
}
|
|
|
|
public static void SetHvacMode(this IClimateEntityCore target, ClimateSetHvacModeParameters data)
|
|
{
|
|
target.CallService("set_hvac_mode", data);
|
|
}
|
|
|
|
public static void SetHvacMode(this IEnumerable<IClimateEntityCore> target, ClimateSetHvacModeParameters data)
|
|
{
|
|
target.CallService("set_hvac_mode", data);
|
|
}
|
|
|
|
///<param name="target">The IClimateEntityCore to call this service for</param>
|
|
///<param name="hvacMode"></param>
|
|
public static void SetHvacMode(this IClimateEntityCore target, object? hvacMode = null)
|
|
{
|
|
target.CallService("set_hvac_mode", new ClimateSetHvacModeParameters { HvacMode = hvacMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IClimateEntityCore> to call this service for</param>
|
|
///<param name="hvacMode"></param>
|
|
public static void SetHvacMode(this IEnumerable<IClimateEntityCore> target, object? hvacMode = null)
|
|
{
|
|
target.CallService("set_hvac_mode", new ClimateSetHvacModeParameters { HvacMode = hvacMode });
|
|
}
|
|
|
|
public static void SetPresetMode(this IClimateEntityCore target, ClimateSetPresetModeParameters data)
|
|
{
|
|
target.CallService("set_preset_mode", data);
|
|
}
|
|
|
|
public static void SetPresetMode(this IEnumerable<IClimateEntityCore> target, ClimateSetPresetModeParameters data)
|
|
{
|
|
target.CallService("set_preset_mode", data);
|
|
}
|
|
|
|
///<param name="target">The IClimateEntityCore to call this service for</param>
|
|
///<param name="presetMode"> eg: away</param>
|
|
public static void SetPresetMode(this IClimateEntityCore target, string presetMode)
|
|
{
|
|
target.CallService("set_preset_mode", new ClimateSetPresetModeParameters { PresetMode = presetMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IClimateEntityCore> to call this service for</param>
|
|
///<param name="presetMode"> eg: away</param>
|
|
public static void SetPresetMode(this IEnumerable<IClimateEntityCore> target, string presetMode)
|
|
{
|
|
target.CallService("set_preset_mode", new ClimateSetPresetModeParameters { PresetMode = presetMode });
|
|
}
|
|
|
|
public static void SetSwingHorizontalMode(this IClimateEntityCore target, ClimateSetSwingHorizontalModeParameters data)
|
|
{
|
|
target.CallService("set_swing_horizontal_mode", data);
|
|
}
|
|
|
|
public static void SetSwingHorizontalMode(this IEnumerable<IClimateEntityCore> target, ClimateSetSwingHorizontalModeParameters data)
|
|
{
|
|
target.CallService("set_swing_horizontal_mode", data);
|
|
}
|
|
|
|
///<param name="target">The IClimateEntityCore to call this service for</param>
|
|
///<param name="swingHorizontalMode"> eg: on</param>
|
|
public static void SetSwingHorizontalMode(this IClimateEntityCore target, string swingHorizontalMode)
|
|
{
|
|
target.CallService("set_swing_horizontal_mode", new ClimateSetSwingHorizontalModeParameters { SwingHorizontalMode = swingHorizontalMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IClimateEntityCore> to call this service for</param>
|
|
///<param name="swingHorizontalMode"> eg: on</param>
|
|
public static void SetSwingHorizontalMode(this IEnumerable<IClimateEntityCore> target, string swingHorizontalMode)
|
|
{
|
|
target.CallService("set_swing_horizontal_mode", new ClimateSetSwingHorizontalModeParameters { SwingHorizontalMode = swingHorizontalMode });
|
|
}
|
|
|
|
public static void SetSwingMode(this IClimateEntityCore target, ClimateSetSwingModeParameters data)
|
|
{
|
|
target.CallService("set_swing_mode", data);
|
|
}
|
|
|
|
public static void SetSwingMode(this IEnumerable<IClimateEntityCore> target, ClimateSetSwingModeParameters data)
|
|
{
|
|
target.CallService("set_swing_mode", data);
|
|
}
|
|
|
|
///<param name="target">The IClimateEntityCore to call this service for</param>
|
|
///<param name="swingMode"> eg: on</param>
|
|
public static void SetSwingMode(this IClimateEntityCore target, string swingMode)
|
|
{
|
|
target.CallService("set_swing_mode", new ClimateSetSwingModeParameters { SwingMode = swingMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IClimateEntityCore> to call this service for</param>
|
|
///<param name="swingMode"> eg: on</param>
|
|
public static void SetSwingMode(this IEnumerable<IClimateEntityCore> target, string swingMode)
|
|
{
|
|
target.CallService("set_swing_mode", new ClimateSetSwingModeParameters { SwingMode = swingMode });
|
|
}
|
|
|
|
public static void SetTemperature(this IClimateEntityCore target, ClimateSetTemperatureParameters data)
|
|
{
|
|
target.CallService("set_temperature", data);
|
|
}
|
|
|
|
public static void SetTemperature(this IEnumerable<IClimateEntityCore> target, ClimateSetTemperatureParameters data)
|
|
{
|
|
target.CallService("set_temperature", data);
|
|
}
|
|
|
|
///<param name="target">The IClimateEntityCore to call this service for</param>
|
|
///<param name="temperature"></param>
|
|
///<param name="targetTempHigh"></param>
|
|
///<param name="targetTempLow"></param>
|
|
///<param name="hvacMode"></param>
|
|
public static void SetTemperature(this IClimateEntityCore target, double? temperature = null, double? targetTempHigh = null, double? targetTempLow = null, object? hvacMode = null)
|
|
{
|
|
target.CallService("set_temperature", new ClimateSetTemperatureParameters { Temperature = temperature, TargetTempHigh = targetTempHigh, TargetTempLow = targetTempLow, HvacMode = hvacMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IClimateEntityCore> to call this service for</param>
|
|
///<param name="temperature"></param>
|
|
///<param name="targetTempHigh"></param>
|
|
///<param name="targetTempLow"></param>
|
|
///<param name="hvacMode"></param>
|
|
public static void SetTemperature(this IEnumerable<IClimateEntityCore> target, double? temperature = null, double? targetTempHigh = null, double? targetTempLow = null, object? hvacMode = null)
|
|
{
|
|
target.CallService("set_temperature", new ClimateSetTemperatureParameters { Temperature = temperature, TargetTempHigh = targetTempHigh, TargetTempLow = targetTempLow, HvacMode = hvacMode });
|
|
}
|
|
|
|
public static void Toggle(this IClimateEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<IClimateEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this IClimateEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<IClimateEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this IClimateEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<IClimateEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
}
|
|
|
|
public static class CounterEntityExtensionMethods
|
|
{
|
|
public static void Decrement(this CounterEntity target, object? data = null)
|
|
{
|
|
target.CallService("decrement", data);
|
|
}
|
|
|
|
public static void Decrement(this IEnumerable<CounterEntity> target, object? data = null)
|
|
{
|
|
target.CallService("decrement", data);
|
|
}
|
|
|
|
public static void Increment(this CounterEntity target, object? data = null)
|
|
{
|
|
target.CallService("increment", data);
|
|
}
|
|
|
|
public static void Increment(this IEnumerable<CounterEntity> target, object? data = null)
|
|
{
|
|
target.CallService("increment", data);
|
|
}
|
|
|
|
public static void Reset(this CounterEntity target, object? data = null)
|
|
{
|
|
target.CallService("reset", data);
|
|
}
|
|
|
|
public static void Reset(this IEnumerable<CounterEntity> target, object? data = null)
|
|
{
|
|
target.CallService("reset", data);
|
|
}
|
|
|
|
public static void SetValue(this CounterEntity target, CounterSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
public static void SetValue(this IEnumerable<CounterEntity> target, CounterSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
///<param name="target">The CounterEntity to call this service for</param>
|
|
///<param name="value"></param>
|
|
public static void SetValue(this CounterEntity target, long value)
|
|
{
|
|
target.CallService("set_value", new CounterSetValueParameters { Value = value });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<CounterEntity> to call this service for</param>
|
|
///<param name="value"></param>
|
|
public static void SetValue(this IEnumerable<CounterEntity> target, long value)
|
|
{
|
|
target.CallService("set_value", new CounterSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public static class FanEntityExtensionMethods
|
|
{
|
|
public static void DecreaseSpeed(this FanEntity target, FanDecreaseSpeedParameters data)
|
|
{
|
|
target.CallService("decrease_speed", data);
|
|
}
|
|
|
|
public static void DecreaseSpeed(this IEnumerable<FanEntity> target, FanDecreaseSpeedParameters data)
|
|
{
|
|
target.CallService("decrease_speed", data);
|
|
}
|
|
|
|
///<param name="target">The FanEntity to call this service for</param>
|
|
///<param name="percentageStep"></param>
|
|
public static void DecreaseSpeed(this FanEntity target, long? percentageStep = null)
|
|
{
|
|
target.CallService("decrease_speed", new FanDecreaseSpeedParameters { PercentageStep = percentageStep });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<FanEntity> to call this service for</param>
|
|
///<param name="percentageStep"></param>
|
|
public static void DecreaseSpeed(this IEnumerable<FanEntity> target, long? percentageStep = null)
|
|
{
|
|
target.CallService("decrease_speed", new FanDecreaseSpeedParameters { PercentageStep = percentageStep });
|
|
}
|
|
|
|
public static void IncreaseSpeed(this FanEntity target, FanIncreaseSpeedParameters data)
|
|
{
|
|
target.CallService("increase_speed", data);
|
|
}
|
|
|
|
public static void IncreaseSpeed(this IEnumerable<FanEntity> target, FanIncreaseSpeedParameters data)
|
|
{
|
|
target.CallService("increase_speed", data);
|
|
}
|
|
|
|
///<param name="target">The FanEntity to call this service for</param>
|
|
///<param name="percentageStep"></param>
|
|
public static void IncreaseSpeed(this FanEntity target, long? percentageStep = null)
|
|
{
|
|
target.CallService("increase_speed", new FanIncreaseSpeedParameters { PercentageStep = percentageStep });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<FanEntity> to call this service for</param>
|
|
///<param name="percentageStep"></param>
|
|
public static void IncreaseSpeed(this IEnumerable<FanEntity> target, long? percentageStep = null)
|
|
{
|
|
target.CallService("increase_speed", new FanIncreaseSpeedParameters { PercentageStep = percentageStep });
|
|
}
|
|
|
|
public static void Oscillate(this FanEntity target, FanOscillateParameters data)
|
|
{
|
|
target.CallService("oscillate", data);
|
|
}
|
|
|
|
public static void Oscillate(this IEnumerable<FanEntity> target, FanOscillateParameters data)
|
|
{
|
|
target.CallService("oscillate", data);
|
|
}
|
|
|
|
///<param name="target">The FanEntity to call this service for</param>
|
|
///<param name="oscillating"></param>
|
|
public static void Oscillate(this FanEntity target, bool oscillating)
|
|
{
|
|
target.CallService("oscillate", new FanOscillateParameters { Oscillating = oscillating });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<FanEntity> to call this service for</param>
|
|
///<param name="oscillating"></param>
|
|
public static void Oscillate(this IEnumerable<FanEntity> target, bool oscillating)
|
|
{
|
|
target.CallService("oscillate", new FanOscillateParameters { Oscillating = oscillating });
|
|
}
|
|
|
|
public static void SetDirection(this FanEntity target, FanSetDirectionParameters data)
|
|
{
|
|
target.CallService("set_direction", data);
|
|
}
|
|
|
|
public static void SetDirection(this IEnumerable<FanEntity> target, FanSetDirectionParameters data)
|
|
{
|
|
target.CallService("set_direction", data);
|
|
}
|
|
|
|
///<param name="target">The FanEntity to call this service for</param>
|
|
///<param name="direction"></param>
|
|
public static void SetDirection(this FanEntity target, object direction)
|
|
{
|
|
target.CallService("set_direction", new FanSetDirectionParameters { Direction = direction });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<FanEntity> to call this service for</param>
|
|
///<param name="direction"></param>
|
|
public static void SetDirection(this IEnumerable<FanEntity> target, object direction)
|
|
{
|
|
target.CallService("set_direction", new FanSetDirectionParameters { Direction = direction });
|
|
}
|
|
|
|
public static void SetPercentage(this FanEntity target, FanSetPercentageParameters data)
|
|
{
|
|
target.CallService("set_percentage", data);
|
|
}
|
|
|
|
public static void SetPercentage(this IEnumerable<FanEntity> target, FanSetPercentageParameters data)
|
|
{
|
|
target.CallService("set_percentage", data);
|
|
}
|
|
|
|
///<param name="target">The FanEntity to call this service for</param>
|
|
///<param name="percentage"></param>
|
|
public static void SetPercentage(this FanEntity target, long percentage)
|
|
{
|
|
target.CallService("set_percentage", new FanSetPercentageParameters { Percentage = percentage });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<FanEntity> to call this service for</param>
|
|
///<param name="percentage"></param>
|
|
public static void SetPercentage(this IEnumerable<FanEntity> target, long percentage)
|
|
{
|
|
target.CallService("set_percentage", new FanSetPercentageParameters { Percentage = percentage });
|
|
}
|
|
|
|
public static void SetPresetMode(this FanEntity target, FanSetPresetModeParameters data)
|
|
{
|
|
target.CallService("set_preset_mode", data);
|
|
}
|
|
|
|
public static void SetPresetMode(this IEnumerable<FanEntity> target, FanSetPresetModeParameters data)
|
|
{
|
|
target.CallService("set_preset_mode", data);
|
|
}
|
|
|
|
///<param name="target">The FanEntity to call this service for</param>
|
|
///<param name="presetMode"> eg: auto</param>
|
|
public static void SetPresetMode(this FanEntity target, string presetMode)
|
|
{
|
|
target.CallService("set_preset_mode", new FanSetPresetModeParameters { PresetMode = presetMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<FanEntity> to call this service for</param>
|
|
///<param name="presetMode"> eg: auto</param>
|
|
public static void SetPresetMode(this IEnumerable<FanEntity> target, string presetMode)
|
|
{
|
|
target.CallService("set_preset_mode", new FanSetPresetModeParameters { PresetMode = presetMode });
|
|
}
|
|
|
|
public static void Toggle(this FanEntity target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<FanEntity> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this FanEntity target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<FanEntity> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this FanEntity target, FanTurnOnParameters data)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<FanEntity> target, FanTurnOnParameters data)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
///<param name="target">The FanEntity to call this service for</param>
|
|
///<param name="percentage"></param>
|
|
///<param name="presetMode"> eg: auto</param>
|
|
public static void TurnOn(this FanEntity target, long? percentage = null, string? presetMode = null)
|
|
{
|
|
target.CallService("turn_on", new FanTurnOnParameters { Percentage = percentage, PresetMode = presetMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<FanEntity> to call this service for</param>
|
|
///<param name="percentage"></param>
|
|
///<param name="presetMode"> eg: auto</param>
|
|
public static void TurnOn(this IEnumerable<FanEntity> target, long? percentage = null, string? presetMode = null)
|
|
{
|
|
target.CallService("turn_on", new FanTurnOnParameters { Percentage = percentage, PresetMode = presetMode });
|
|
}
|
|
}
|
|
|
|
public static class HumidifierEntityExtensionMethods
|
|
{
|
|
public static void SetHumidity(this HumidifierEntity target, HumidifierSetHumidityParameters data)
|
|
{
|
|
target.CallService("set_humidity", data);
|
|
}
|
|
|
|
public static void SetHumidity(this IEnumerable<HumidifierEntity> target, HumidifierSetHumidityParameters data)
|
|
{
|
|
target.CallService("set_humidity", data);
|
|
}
|
|
|
|
///<param name="target">The HumidifierEntity to call this service for</param>
|
|
///<param name="humidity"></param>
|
|
public static void SetHumidity(this HumidifierEntity target, long humidity)
|
|
{
|
|
target.CallService("set_humidity", new HumidifierSetHumidityParameters { Humidity = humidity });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<HumidifierEntity> to call this service for</param>
|
|
///<param name="humidity"></param>
|
|
public static void SetHumidity(this IEnumerable<HumidifierEntity> target, long humidity)
|
|
{
|
|
target.CallService("set_humidity", new HumidifierSetHumidityParameters { Humidity = humidity });
|
|
}
|
|
|
|
public static void SetMode(this HumidifierEntity target, HumidifierSetModeParameters data)
|
|
{
|
|
target.CallService("set_mode", data);
|
|
}
|
|
|
|
public static void SetMode(this IEnumerable<HumidifierEntity> target, HumidifierSetModeParameters data)
|
|
{
|
|
target.CallService("set_mode", data);
|
|
}
|
|
|
|
///<param name="target">The HumidifierEntity to call this service for</param>
|
|
///<param name="mode"> eg: away</param>
|
|
public static void SetMode(this HumidifierEntity target, string mode)
|
|
{
|
|
target.CallService("set_mode", new HumidifierSetModeParameters { Mode = mode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<HumidifierEntity> to call this service for</param>
|
|
///<param name="mode"> eg: away</param>
|
|
public static void SetMode(this IEnumerable<HumidifierEntity> target, string mode)
|
|
{
|
|
target.CallService("set_mode", new HumidifierSetModeParameters { Mode = mode });
|
|
}
|
|
|
|
public static void Toggle(this HumidifierEntity target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<HumidifierEntity> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this HumidifierEntity target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<HumidifierEntity> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this HumidifierEntity target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<HumidifierEntity> target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
}
|
|
|
|
public static class InputBooleanEntityExtensionMethods
|
|
{
|
|
public static void Toggle(this IInputBooleanEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<IInputBooleanEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this IInputBooleanEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<IInputBooleanEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this IInputBooleanEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<IInputBooleanEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
}
|
|
|
|
public static class InputDatetimeEntityExtensionMethods
|
|
{
|
|
public static void SetDatetime(this IInputDatetimeEntityCore target, InputDatetimeSetDatetimeParameters data)
|
|
{
|
|
target.CallService("set_datetime", data);
|
|
}
|
|
|
|
public static void SetDatetime(this IEnumerable<IInputDatetimeEntityCore> target, InputDatetimeSetDatetimeParameters data)
|
|
{
|
|
target.CallService("set_datetime", data);
|
|
}
|
|
|
|
///<param name="target">The IInputDatetimeEntityCore to call this service for</param>
|
|
///<param name="date"> eg: "2019-04-20"</param>
|
|
///<param name="time"> eg: "05:04:20"</param>
|
|
///<param name="datetime"> eg: "2019-04-20 05:04:20"</param>
|
|
///<param name="timestamp"></param>
|
|
public static void SetDatetime(this IInputDatetimeEntityCore target, string? date = null, TimeOnly? time = null, string? datetime = null, long? timestamp = null)
|
|
{
|
|
target.CallService("set_datetime", new InputDatetimeSetDatetimeParameters { Date = date, Time = time, Datetime = datetime, Timestamp = timestamp });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IInputDatetimeEntityCore> to call this service for</param>
|
|
///<param name="date"> eg: "2019-04-20"</param>
|
|
///<param name="time"> eg: "05:04:20"</param>
|
|
///<param name="datetime"> eg: "2019-04-20 05:04:20"</param>
|
|
///<param name="timestamp"></param>
|
|
public static void SetDatetime(this IEnumerable<IInputDatetimeEntityCore> target, string? date = null, TimeOnly? time = null, string? datetime = null, long? timestamp = null)
|
|
{
|
|
target.CallService("set_datetime", new InputDatetimeSetDatetimeParameters { Date = date, Time = time, Datetime = datetime, Timestamp = timestamp });
|
|
}
|
|
}
|
|
|
|
public static class InputNumberEntityExtensionMethods
|
|
{
|
|
///<summary>Decrease an input number entity value by a certain amount.</summary>
|
|
public static void Decrement(this IInputNumberEntityCore target, InputNumberDecrementParameters data)
|
|
{
|
|
target.CallService("decrement", data);
|
|
}
|
|
|
|
///<summary>Decrease an input number entity value by a certain amount.</summary>
|
|
public static void Decrement(this IEnumerable<IInputNumberEntityCore> target, InputNumberDecrementParameters data)
|
|
{
|
|
target.CallService("decrement", data);
|
|
}
|
|
|
|
///<summary>Decrease an input number entity value by a certain amount.</summary>
|
|
///<param name="target">The IInputNumberEntityCore to call this service for</param>
|
|
///<param name="amount">The amount to decrease the input number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Decrement(this IInputNumberEntityCore target, long? amount = null)
|
|
{
|
|
target.CallService("decrement", new InputNumberDecrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Decrease an input number entity value by a certain amount.</summary>
|
|
///<param name="target">The IEnumerable<IInputNumberEntityCore> to call this service for</param>
|
|
///<param name="amount">The amount to decrease the input number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Decrement(this IEnumerable<IInputNumberEntityCore> target, long? amount = null)
|
|
{
|
|
target.CallService("decrement", new InputNumberDecrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Increase an input number entity value by a certain amount.</summary>
|
|
public static void Increment(this IInputNumberEntityCore target, InputNumberIncrementParameters data)
|
|
{
|
|
target.CallService("increment", data);
|
|
}
|
|
|
|
///<summary>Increase an input number entity value by a certain amount.</summary>
|
|
public static void Increment(this IEnumerable<IInputNumberEntityCore> target, InputNumberIncrementParameters data)
|
|
{
|
|
target.CallService("increment", data);
|
|
}
|
|
|
|
///<summary>Increase an input number entity value by a certain amount.</summary>
|
|
///<param name="target">The IInputNumberEntityCore to call this service for</param>
|
|
///<param name="amount">The amount to increase the input number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Increment(this IInputNumberEntityCore target, long? amount = null)
|
|
{
|
|
target.CallService("increment", new InputNumberIncrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Increase an input number entity value by a certain amount.</summary>
|
|
///<param name="target">The IEnumerable<IInputNumberEntityCore> to call this service for</param>
|
|
///<param name="amount">The amount to increase the input number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Increment(this IEnumerable<IInputNumberEntityCore> target, long? amount = null)
|
|
{
|
|
target.CallService("increment", new InputNumberIncrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Set an input number entity to its maximum value.</summary>
|
|
public static void Max(this IInputNumberEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("max", data);
|
|
}
|
|
|
|
///<summary>Set an input number entity to its maximum value.</summary>
|
|
public static void Max(this IEnumerable<IInputNumberEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("max", data);
|
|
}
|
|
|
|
///<summary>Set an input number entity to its minimum value.</summary>
|
|
public static void Min(this IInputNumberEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("min", data);
|
|
}
|
|
|
|
///<summary>Set an input number entity to its minimum value.</summary>
|
|
public static void Min(this IEnumerable<IInputNumberEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("min", data);
|
|
}
|
|
|
|
public static void SetValue(this IInputNumberEntityCore target, InputNumberSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
public static void SetValue(this IEnumerable<IInputNumberEntityCore> target, InputNumberSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
///<param name="target">The IInputNumberEntityCore to call this service for</param>
|
|
///<param name="value"></param>
|
|
public static void SetValue(this IInputNumberEntityCore target, double value)
|
|
{
|
|
target.CallService("set_value", new InputNumberSetValueParameters { Value = value });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IInputNumberEntityCore> to call this service for</param>
|
|
///<param name="value"></param>
|
|
public static void SetValue(this IEnumerable<IInputNumberEntityCore> target, double value)
|
|
{
|
|
target.CallService("set_value", new InputNumberSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public static class LightEntityExtensionMethods
|
|
{
|
|
public static void Toggle(this ILightEntityCore target, LightToggleParameters data)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<ILightEntityCore> target, LightToggleParameters data)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
///<param name="target">The ILightEntityCore to call this service for</param>
|
|
///<param name="transition"></param>
|
|
///<param name="rgbColor"> eg: [255, 100, 100]</param>
|
|
///<param name="colorTempKelvin"></param>
|
|
///<param name="brightnessPct"></param>
|
|
///<param name="effect"></param>
|
|
///<param name="rgbwColor"> eg: [255, 100, 100, 50]</param>
|
|
///<param name="rgbwwColor"> eg: [255, 100, 100, 50, 70]</param>
|
|
///<param name="colorName"></param>
|
|
///<param name="hsColor"> eg: [300, 70]</param>
|
|
///<param name="xyColor"> eg: [0.52, 0.43]</param>
|
|
///<param name="brightness"></param>
|
|
///<param name="white"></param>
|
|
///<param name="profile"> eg: relax</param>
|
|
///<param name="flash"></param>
|
|
public static void Toggle(this ILightEntityCore target, long? transition = null, IReadOnlyCollection<int>? rgbColor = null, object? colorTempKelvin = null, long? brightnessPct = null, string? effect = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, long? brightness = null, object? white = null, string? profile = null, object? flash = null)
|
|
{
|
|
target.CallService("toggle", new LightToggleParameters { Transition = transition, RgbColor = rgbColor, ColorTempKelvin = colorTempKelvin, BrightnessPct = brightnessPct, Effect = effect, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, Brightness = brightness, White = white, Profile = profile, Flash = flash });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<ILightEntityCore> to call this service for</param>
|
|
///<param name="transition"></param>
|
|
///<param name="rgbColor"> eg: [255, 100, 100]</param>
|
|
///<param name="colorTempKelvin"></param>
|
|
///<param name="brightnessPct"></param>
|
|
///<param name="effect"></param>
|
|
///<param name="rgbwColor"> eg: [255, 100, 100, 50]</param>
|
|
///<param name="rgbwwColor"> eg: [255, 100, 100, 50, 70]</param>
|
|
///<param name="colorName"></param>
|
|
///<param name="hsColor"> eg: [300, 70]</param>
|
|
///<param name="xyColor"> eg: [0.52, 0.43]</param>
|
|
///<param name="brightness"></param>
|
|
///<param name="white"></param>
|
|
///<param name="profile"> eg: relax</param>
|
|
///<param name="flash"></param>
|
|
public static void Toggle(this IEnumerable<ILightEntityCore> target, long? transition = null, IReadOnlyCollection<int>? rgbColor = null, object? colorTempKelvin = null, long? brightnessPct = null, string? effect = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, long? brightness = null, object? white = null, string? profile = null, object? flash = null)
|
|
{
|
|
target.CallService("toggle", new LightToggleParameters { Transition = transition, RgbColor = rgbColor, ColorTempKelvin = colorTempKelvin, BrightnessPct = brightnessPct, Effect = effect, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, Brightness = brightness, White = white, Profile = profile, Flash = flash });
|
|
}
|
|
|
|
public static void TurnOff(this ILightEntityCore target, LightTurnOffParameters data)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<ILightEntityCore> target, LightTurnOffParameters data)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
///<param name="target">The ILightEntityCore to call this service for</param>
|
|
///<param name="transition"></param>
|
|
///<param name="flash"></param>
|
|
public static void TurnOff(this ILightEntityCore target, long? transition = null, object? flash = null)
|
|
{
|
|
target.CallService("turn_off", new LightTurnOffParameters { Transition = transition, Flash = flash });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<ILightEntityCore> to call this service for</param>
|
|
///<param name="transition"></param>
|
|
///<param name="flash"></param>
|
|
public static void TurnOff(this IEnumerable<ILightEntityCore> target, long? transition = null, object? flash = null)
|
|
{
|
|
target.CallService("turn_off", new LightTurnOffParameters { Transition = transition, Flash = flash });
|
|
}
|
|
|
|
public static void TurnOn(this ILightEntityCore target, LightTurnOnParameters data)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<ILightEntityCore> target, LightTurnOnParameters data)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
///<param name="target">The ILightEntityCore to call this service for</param>
|
|
///<param name="transition"></param>
|
|
///<param name="rgbColor"> eg: [255, 100, 100]</param>
|
|
///<param name="colorTempKelvin"></param>
|
|
///<param name="brightnessPct"></param>
|
|
///<param name="brightnessStepPct"></param>
|
|
///<param name="effect"></param>
|
|
///<param name="rgbwColor"> eg: [255, 100, 100, 50]</param>
|
|
///<param name="rgbwwColor"> eg: [255, 100, 100, 50, 70]</param>
|
|
///<param name="colorName"></param>
|
|
///<param name="hsColor"> eg: [300, 70]</param>
|
|
///<param name="xyColor"> eg: [0.52, 0.43]</param>
|
|
///<param name="brightness"></param>
|
|
///<param name="brightnessStep"></param>
|
|
///<param name="white"></param>
|
|
///<param name="profile"> eg: relax</param>
|
|
///<param name="flash"></param>
|
|
public static void TurnOn(this ILightEntityCore target, long? transition = null, IReadOnlyCollection<int>? rgbColor = null, object? colorTempKelvin = null, long? brightnessPct = null, long? brightnessStepPct = null, string? effect = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, long? brightness = null, long? brightnessStep = null, object? white = null, string? profile = null, object? flash = null)
|
|
{
|
|
target.CallService("turn_on", new LightTurnOnParameters { Transition = transition, RgbColor = rgbColor, ColorTempKelvin = colorTempKelvin, BrightnessPct = brightnessPct, BrightnessStepPct = brightnessStepPct, Effect = effect, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, Brightness = brightness, BrightnessStep = brightnessStep, White = white, Profile = profile, Flash = flash });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<ILightEntityCore> to call this service for</param>
|
|
///<param name="transition"></param>
|
|
///<param name="rgbColor"> eg: [255, 100, 100]</param>
|
|
///<param name="colorTempKelvin"></param>
|
|
///<param name="brightnessPct"></param>
|
|
///<param name="brightnessStepPct"></param>
|
|
///<param name="effect"></param>
|
|
///<param name="rgbwColor"> eg: [255, 100, 100, 50]</param>
|
|
///<param name="rgbwwColor"> eg: [255, 100, 100, 50, 70]</param>
|
|
///<param name="colorName"></param>
|
|
///<param name="hsColor"> eg: [300, 70]</param>
|
|
///<param name="xyColor"> eg: [0.52, 0.43]</param>
|
|
///<param name="brightness"></param>
|
|
///<param name="brightnessStep"></param>
|
|
///<param name="white"></param>
|
|
///<param name="profile"> eg: relax</param>
|
|
///<param name="flash"></param>
|
|
public static void TurnOn(this IEnumerable<ILightEntityCore> target, long? transition = null, IReadOnlyCollection<int>? rgbColor = null, object? colorTempKelvin = null, long? brightnessPct = null, long? brightnessStepPct = null, string? effect = null, object? rgbwColor = null, object? rgbwwColor = null, object? colorName = null, object? hsColor = null, object? xyColor = null, long? brightness = null, long? brightnessStep = null, object? white = null, string? profile = null, object? flash = null)
|
|
{
|
|
target.CallService("turn_on", new LightTurnOnParameters { Transition = transition, RgbColor = rgbColor, ColorTempKelvin = colorTempKelvin, BrightnessPct = brightnessPct, BrightnessStepPct = brightnessStepPct, Effect = effect, RgbwColor = rgbwColor, RgbwwColor = rgbwwColor, ColorName = colorName, HsColor = hsColor, XyColor = xyColor, Brightness = brightness, BrightnessStep = brightnessStep, White = white, Profile = profile, Flash = flash });
|
|
}
|
|
}
|
|
|
|
public static class MediaPlayerEntityExtensionMethods
|
|
{
|
|
public static Task<JsonElement?> BrowseMediaAsync(this IMediaPlayerEntityCore target, MediaPlayerBrowseMediaParameters data)
|
|
{
|
|
return target.CallServiceWithResponseAsync("browse_media", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
public static Task<JsonElement?> BrowseMediaAsync(this IMediaPlayerEntityCore target, string? mediaContentType = null, string? mediaContentId = null)
|
|
{
|
|
return target.CallServiceWithResponseAsync("browse_media", new MediaPlayerBrowseMediaParameters { MediaContentType = mediaContentType, MediaContentId = mediaContentId });
|
|
}
|
|
|
|
public static void BrowseMedia(this IMediaPlayerEntityCore target, MediaPlayerBrowseMediaParameters data)
|
|
{
|
|
target.CallService("browse_media", data);
|
|
}
|
|
|
|
public static void BrowseMedia(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerBrowseMediaParameters data)
|
|
{
|
|
target.CallService("browse_media", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
public static void BrowseMedia(this IMediaPlayerEntityCore target, string? mediaContentType = null, string? mediaContentId = null)
|
|
{
|
|
target.CallService("browse_media", new MediaPlayerBrowseMediaParameters { MediaContentType = mediaContentType, MediaContentId = mediaContentId });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
public static void BrowseMedia(this IEnumerable<IMediaPlayerEntityCore> target, string? mediaContentType = null, string? mediaContentId = null)
|
|
{
|
|
target.CallService("browse_media", new MediaPlayerBrowseMediaParameters { MediaContentType = mediaContentType, MediaContentId = mediaContentId });
|
|
}
|
|
|
|
public static void ClearPlaylist(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("clear_playlist", data);
|
|
}
|
|
|
|
public static void ClearPlaylist(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("clear_playlist", data);
|
|
}
|
|
|
|
public static void Join(this IMediaPlayerEntityCore target, MediaPlayerJoinParameters data)
|
|
{
|
|
target.CallService("join", data);
|
|
}
|
|
|
|
public static void Join(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerJoinParameters data)
|
|
{
|
|
target.CallService("join", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="groupMembers"> eg: - media_player.multiroom_player2 - media_player.multiroom_player3 </param>
|
|
public static void Join(this IMediaPlayerEntityCore target, IEnumerable<string> groupMembers)
|
|
{
|
|
target.CallService("join", new MediaPlayerJoinParameters { GroupMembers = groupMembers });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="groupMembers"> eg: - media_player.multiroom_player2 - media_player.multiroom_player3 </param>
|
|
public static void Join(this IEnumerable<IMediaPlayerEntityCore> target, IEnumerable<string> groupMembers)
|
|
{
|
|
target.CallService("join", new MediaPlayerJoinParameters { GroupMembers = groupMembers });
|
|
}
|
|
|
|
public static void MediaNextTrack(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("media_next_track", data);
|
|
}
|
|
|
|
public static void MediaNextTrack(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("media_next_track", data);
|
|
}
|
|
|
|
public static void MediaPause(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("media_pause", data);
|
|
}
|
|
|
|
public static void MediaPause(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("media_pause", data);
|
|
}
|
|
|
|
public static void MediaPlay(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("media_play", data);
|
|
}
|
|
|
|
public static void MediaPlay(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("media_play", data);
|
|
}
|
|
|
|
public static void MediaPlayPause(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("media_play_pause", data);
|
|
}
|
|
|
|
public static void MediaPlayPause(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("media_play_pause", data);
|
|
}
|
|
|
|
public static void MediaPreviousTrack(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("media_previous_track", data);
|
|
}
|
|
|
|
public static void MediaPreviousTrack(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("media_previous_track", data);
|
|
}
|
|
|
|
public static void MediaSeek(this IMediaPlayerEntityCore target, MediaPlayerMediaSeekParameters data)
|
|
{
|
|
target.CallService("media_seek", data);
|
|
}
|
|
|
|
public static void MediaSeek(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerMediaSeekParameters data)
|
|
{
|
|
target.CallService("media_seek", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="seekPosition"></param>
|
|
public static void MediaSeek(this IMediaPlayerEntityCore target, double seekPosition)
|
|
{
|
|
target.CallService("media_seek", new MediaPlayerMediaSeekParameters { SeekPosition = seekPosition });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="seekPosition"></param>
|
|
public static void MediaSeek(this IEnumerable<IMediaPlayerEntityCore> target, double seekPosition)
|
|
{
|
|
target.CallService("media_seek", new MediaPlayerMediaSeekParameters { SeekPosition = seekPosition });
|
|
}
|
|
|
|
public static void MediaStop(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("media_stop", data);
|
|
}
|
|
|
|
public static void MediaStop(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("media_stop", data);
|
|
}
|
|
|
|
public static void PlayMedia(this IMediaPlayerEntityCore target, MediaPlayerPlayMediaParameters data)
|
|
{
|
|
target.CallService("play_media", data);
|
|
}
|
|
|
|
public static void PlayMedia(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerPlayMediaParameters data)
|
|
{
|
|
target.CallService("play_media", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="media"> eg: {"media_content_id": "https://home-assistant.io/images/cast/splash.png", "media_content_type": "music"}</param>
|
|
///<param name="enqueue"></param>
|
|
///<param name="announce"> eg: true</param>
|
|
public static void PlayMedia(this IMediaPlayerEntityCore target, object media, object? enqueue = null, bool? announce = null)
|
|
{
|
|
target.CallService("play_media", new MediaPlayerPlayMediaParameters { Media = media, Enqueue = enqueue, Announce = announce });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="media"> eg: {"media_content_id": "https://home-assistant.io/images/cast/splash.png", "media_content_type": "music"}</param>
|
|
///<param name="enqueue"></param>
|
|
///<param name="announce"> eg: true</param>
|
|
public static void PlayMedia(this IEnumerable<IMediaPlayerEntityCore> target, object media, object? enqueue = null, bool? announce = null)
|
|
{
|
|
target.CallService("play_media", new MediaPlayerPlayMediaParameters { Media = media, Enqueue = enqueue, Announce = announce });
|
|
}
|
|
|
|
public static void RepeatSet(this IMediaPlayerEntityCore target, MediaPlayerRepeatSetParameters data)
|
|
{
|
|
target.CallService("repeat_set", data);
|
|
}
|
|
|
|
public static void RepeatSet(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerRepeatSetParameters data)
|
|
{
|
|
target.CallService("repeat_set", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="repeat"></param>
|
|
public static void RepeatSet(this IMediaPlayerEntityCore target, object repeat)
|
|
{
|
|
target.CallService("repeat_set", new MediaPlayerRepeatSetParameters { Repeat = repeat });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="repeat"></param>
|
|
public static void RepeatSet(this IEnumerable<IMediaPlayerEntityCore> target, object repeat)
|
|
{
|
|
target.CallService("repeat_set", new MediaPlayerRepeatSetParameters { Repeat = repeat });
|
|
}
|
|
|
|
public static Task<JsonElement?> SearchMediaAsync(this IMediaPlayerEntityCore target, MediaPlayerSearchMediaParameters data)
|
|
{
|
|
return target.CallServiceWithResponseAsync("search_media", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="searchQuery"> eg: Beatles</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
///<param name="mediaFilterClasses"> eg: ["album","artist"]</param>
|
|
public static Task<JsonElement?> SearchMediaAsync(this IMediaPlayerEntityCore target, string searchQuery, string? mediaContentType = null, string? mediaContentId = null, IEnumerable<string>? mediaFilterClasses = null)
|
|
{
|
|
return target.CallServiceWithResponseAsync("search_media", new MediaPlayerSearchMediaParameters { SearchQuery = searchQuery, MediaContentType = mediaContentType, MediaContentId = mediaContentId, MediaFilterClasses = mediaFilterClasses });
|
|
}
|
|
|
|
public static void SearchMedia(this IMediaPlayerEntityCore target, MediaPlayerSearchMediaParameters data)
|
|
{
|
|
target.CallService("search_media", data);
|
|
}
|
|
|
|
public static void SearchMedia(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerSearchMediaParameters data)
|
|
{
|
|
target.CallService("search_media", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="searchQuery"> eg: Beatles</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
///<param name="mediaFilterClasses"> eg: ["album","artist"]</param>
|
|
public static void SearchMedia(this IMediaPlayerEntityCore target, string searchQuery, string? mediaContentType = null, string? mediaContentId = null, IEnumerable<string>? mediaFilterClasses = null)
|
|
{
|
|
target.CallService("search_media", new MediaPlayerSearchMediaParameters { SearchQuery = searchQuery, MediaContentType = mediaContentType, MediaContentId = mediaContentId, MediaFilterClasses = mediaFilterClasses });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="searchQuery"> eg: Beatles</param>
|
|
///<param name="mediaContentType"> eg: music</param>
|
|
///<param name="mediaContentId"> eg: A:ALBUMARTIST/Beatles</param>
|
|
///<param name="mediaFilterClasses"> eg: ["album","artist"]</param>
|
|
public static void SearchMedia(this IEnumerable<IMediaPlayerEntityCore> target, string searchQuery, string? mediaContentType = null, string? mediaContentId = null, IEnumerable<string>? mediaFilterClasses = null)
|
|
{
|
|
target.CallService("search_media", new MediaPlayerSearchMediaParameters { SearchQuery = searchQuery, MediaContentType = mediaContentType, MediaContentId = mediaContentId, MediaFilterClasses = mediaFilterClasses });
|
|
}
|
|
|
|
public static void SelectSoundMode(this IMediaPlayerEntityCore target, MediaPlayerSelectSoundModeParameters data)
|
|
{
|
|
target.CallService("select_sound_mode", data);
|
|
}
|
|
|
|
public static void SelectSoundMode(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerSelectSoundModeParameters data)
|
|
{
|
|
target.CallService("select_sound_mode", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="soundMode"> eg: Music</param>
|
|
public static void SelectSoundMode(this IMediaPlayerEntityCore target, string? soundMode = null)
|
|
{
|
|
target.CallService("select_sound_mode", new MediaPlayerSelectSoundModeParameters { SoundMode = soundMode });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="soundMode"> eg: Music</param>
|
|
public static void SelectSoundMode(this IEnumerable<IMediaPlayerEntityCore> target, string? soundMode = null)
|
|
{
|
|
target.CallService("select_sound_mode", new MediaPlayerSelectSoundModeParameters { SoundMode = soundMode });
|
|
}
|
|
|
|
public static void SelectSource(this IMediaPlayerEntityCore target, MediaPlayerSelectSourceParameters data)
|
|
{
|
|
target.CallService("select_source", data);
|
|
}
|
|
|
|
public static void SelectSource(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerSelectSourceParameters data)
|
|
{
|
|
target.CallService("select_source", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="source"> eg: video1</param>
|
|
public static void SelectSource(this IMediaPlayerEntityCore target, string source)
|
|
{
|
|
target.CallService("select_source", new MediaPlayerSelectSourceParameters { Source = source });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="source"> eg: video1</param>
|
|
public static void SelectSource(this IEnumerable<IMediaPlayerEntityCore> target, string source)
|
|
{
|
|
target.CallService("select_source", new MediaPlayerSelectSourceParameters { Source = source });
|
|
}
|
|
|
|
public static void ShuffleSet(this IMediaPlayerEntityCore target, MediaPlayerShuffleSetParameters data)
|
|
{
|
|
target.CallService("shuffle_set", data);
|
|
}
|
|
|
|
public static void ShuffleSet(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerShuffleSetParameters data)
|
|
{
|
|
target.CallService("shuffle_set", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="shuffle"></param>
|
|
public static void ShuffleSet(this IMediaPlayerEntityCore target, bool shuffle)
|
|
{
|
|
target.CallService("shuffle_set", new MediaPlayerShuffleSetParameters { Shuffle = shuffle });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="shuffle"></param>
|
|
public static void ShuffleSet(this IEnumerable<IMediaPlayerEntityCore> target, bool shuffle)
|
|
{
|
|
target.CallService("shuffle_set", new MediaPlayerShuffleSetParameters { Shuffle = shuffle });
|
|
}
|
|
|
|
public static void Toggle(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void Unjoin(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("unjoin", data);
|
|
}
|
|
|
|
public static void Unjoin(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("unjoin", data);
|
|
}
|
|
|
|
public static void VolumeDown(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("volume_down", data);
|
|
}
|
|
|
|
public static void VolumeDown(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("volume_down", data);
|
|
}
|
|
|
|
public static void VolumeMute(this IMediaPlayerEntityCore target, MediaPlayerVolumeMuteParameters data)
|
|
{
|
|
target.CallService("volume_mute", data);
|
|
}
|
|
|
|
public static void VolumeMute(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerVolumeMuteParameters data)
|
|
{
|
|
target.CallService("volume_mute", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="isVolumeMuted"></param>
|
|
public static void VolumeMute(this IMediaPlayerEntityCore target, bool isVolumeMuted)
|
|
{
|
|
target.CallService("volume_mute", new MediaPlayerVolumeMuteParameters { IsVolumeMuted = isVolumeMuted });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="isVolumeMuted"></param>
|
|
public static void VolumeMute(this IEnumerable<IMediaPlayerEntityCore> target, bool isVolumeMuted)
|
|
{
|
|
target.CallService("volume_mute", new MediaPlayerVolumeMuteParameters { IsVolumeMuted = isVolumeMuted });
|
|
}
|
|
|
|
public static void VolumeSet(this IMediaPlayerEntityCore target, MediaPlayerVolumeSetParameters data)
|
|
{
|
|
target.CallService("volume_set", data);
|
|
}
|
|
|
|
public static void VolumeSet(this IEnumerable<IMediaPlayerEntityCore> target, MediaPlayerVolumeSetParameters data)
|
|
{
|
|
target.CallService("volume_set", data);
|
|
}
|
|
|
|
///<param name="target">The IMediaPlayerEntityCore to call this service for</param>
|
|
///<param name="volumeLevel"></param>
|
|
public static void VolumeSet(this IMediaPlayerEntityCore target, double volumeLevel)
|
|
{
|
|
target.CallService("volume_set", new MediaPlayerVolumeSetParameters { VolumeLevel = volumeLevel });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IMediaPlayerEntityCore> to call this service for</param>
|
|
///<param name="volumeLevel"></param>
|
|
public static void VolumeSet(this IEnumerable<IMediaPlayerEntityCore> target, double volumeLevel)
|
|
{
|
|
target.CallService("volume_set", new MediaPlayerVolumeSetParameters { VolumeLevel = volumeLevel });
|
|
}
|
|
|
|
public static void VolumeUp(this IMediaPlayerEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("volume_up", data);
|
|
}
|
|
|
|
public static void VolumeUp(this IEnumerable<IMediaPlayerEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("volume_up", data);
|
|
}
|
|
}
|
|
|
|
public static class NumberEntityExtensionMethods
|
|
{
|
|
///<summary>Decrease a number entity value by a certain amount.</summary>
|
|
public static void Decrement(this INumberEntityCore target, NumberDecrementParameters data)
|
|
{
|
|
target.CallService("decrement", data);
|
|
}
|
|
|
|
///<summary>Decrease a number entity value by a certain amount.</summary>
|
|
public static void Decrement(this IEnumerable<INumberEntityCore> target, NumberDecrementParameters data)
|
|
{
|
|
target.CallService("decrement", data);
|
|
}
|
|
|
|
///<summary>Decrease a number entity value by a certain amount.</summary>
|
|
///<param name="target">The INumberEntityCore to call this service for</param>
|
|
///<param name="amount">The amount to decrease the number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Decrement(this INumberEntityCore target, long? amount = null)
|
|
{
|
|
target.CallService("decrement", new NumberDecrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Decrease a number entity value by a certain amount.</summary>
|
|
///<param name="target">The IEnumerable<INumberEntityCore> to call this service for</param>
|
|
///<param name="amount">The amount to decrease the number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Decrement(this IEnumerable<INumberEntityCore> target, long? amount = null)
|
|
{
|
|
target.CallService("decrement", new NumberDecrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Increase a number entity value by a certain amount.</summary>
|
|
public static void Increment(this INumberEntityCore target, NumberIncrementParameters data)
|
|
{
|
|
target.CallService("increment", data);
|
|
}
|
|
|
|
///<summary>Increase a number entity value by a certain amount.</summary>
|
|
public static void Increment(this IEnumerable<INumberEntityCore> target, NumberIncrementParameters data)
|
|
{
|
|
target.CallService("increment", data);
|
|
}
|
|
|
|
///<summary>Increase a number entity value by a certain amount.</summary>
|
|
///<param name="target">The INumberEntityCore to call this service for</param>
|
|
///<param name="amount">The amount to increase the number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Increment(this INumberEntityCore target, long? amount = null)
|
|
{
|
|
target.CallService("increment", new NumberIncrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Increase a number entity value by a certain amount.</summary>
|
|
///<param name="target">The IEnumerable<INumberEntityCore> to call this service for</param>
|
|
///<param name="amount">The amount to increase the number with. If not provided, the step of the number entity will be used.</param>
|
|
public static void Increment(this IEnumerable<INumberEntityCore> target, long? amount = null)
|
|
{
|
|
target.CallService("increment", new NumberIncrementParameters { Amount = amount });
|
|
}
|
|
|
|
///<summary>Set a number entity to its maximum value.</summary>
|
|
public static void Max(this INumberEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("max", data);
|
|
}
|
|
|
|
///<summary>Set a number entity to its maximum value.</summary>
|
|
public static void Max(this IEnumerable<INumberEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("max", data);
|
|
}
|
|
|
|
///<summary>Set a number entity to its minimum value.</summary>
|
|
public static void Min(this INumberEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("min", data);
|
|
}
|
|
|
|
///<summary>Set a number entity to its minimum value.</summary>
|
|
public static void Min(this IEnumerable<INumberEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("min", data);
|
|
}
|
|
|
|
public static void SetValue(this INumberEntityCore target, NumberSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
public static void SetValue(this IEnumerable<INumberEntityCore> target, NumberSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
///<param name="target">The INumberEntityCore to call this service for</param>
|
|
///<param name="value"> eg: 42</param>
|
|
public static void SetValue(this INumberEntityCore target, string value)
|
|
{
|
|
target.CallService("set_value", new NumberSetValueParameters { Value = value });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<INumberEntityCore> to call this service for</param>
|
|
///<param name="value"> eg: 42</param>
|
|
public static void SetValue(this IEnumerable<INumberEntityCore> target, string value)
|
|
{
|
|
target.CallService("set_value", new NumberSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public static class RemoteEntityExtensionMethods
|
|
{
|
|
public static void DeleteCommand(this IRemoteEntityCore target, RemoteDeleteCommandParameters data)
|
|
{
|
|
target.CallService("delete_command", data);
|
|
}
|
|
|
|
public static void DeleteCommand(this IEnumerable<IRemoteEntityCore> target, RemoteDeleteCommandParameters data)
|
|
{
|
|
target.CallService("delete_command", data);
|
|
}
|
|
|
|
///<param name="target">The IRemoteEntityCore to call this service for</param>
|
|
///<param name="device"> eg: television</param>
|
|
///<param name="command"> eg: Mute</param>
|
|
public static void DeleteCommand(this IRemoteEntityCore target, object command, string? device = null)
|
|
{
|
|
target.CallService("delete_command", new RemoteDeleteCommandParameters { Device = device, Command = command });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IRemoteEntityCore> to call this service for</param>
|
|
///<param name="device"> eg: television</param>
|
|
///<param name="command"> eg: Mute</param>
|
|
public static void DeleteCommand(this IEnumerable<IRemoteEntityCore> target, object command, string? device = null)
|
|
{
|
|
target.CallService("delete_command", new RemoteDeleteCommandParameters { Device = device, Command = command });
|
|
}
|
|
|
|
public static void LearnCommand(this IRemoteEntityCore target, RemoteLearnCommandParameters data)
|
|
{
|
|
target.CallService("learn_command", data);
|
|
}
|
|
|
|
public static void LearnCommand(this IEnumerable<IRemoteEntityCore> target, RemoteLearnCommandParameters data)
|
|
{
|
|
target.CallService("learn_command", data);
|
|
}
|
|
|
|
///<param name="target">The IRemoteEntityCore to call this service for</param>
|
|
///<param name="device"> eg: television</param>
|
|
///<param name="command"> eg: Turn on</param>
|
|
///<param name="commandType"></param>
|
|
///<param name="alternative"></param>
|
|
///<param name="timeout"></param>
|
|
public static void LearnCommand(this IRemoteEntityCore target, string? device = null, object? command = null, object? commandType = null, bool? alternative = null, long? timeout = null)
|
|
{
|
|
target.CallService("learn_command", new RemoteLearnCommandParameters { Device = device, Command = command, CommandType = commandType, Alternative = alternative, Timeout = timeout });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IRemoteEntityCore> to call this service for</param>
|
|
///<param name="device"> eg: television</param>
|
|
///<param name="command"> eg: Turn on</param>
|
|
///<param name="commandType"></param>
|
|
///<param name="alternative"></param>
|
|
///<param name="timeout"></param>
|
|
public static void LearnCommand(this IEnumerable<IRemoteEntityCore> target, string? device = null, object? command = null, object? commandType = null, bool? alternative = null, long? timeout = null)
|
|
{
|
|
target.CallService("learn_command", new RemoteLearnCommandParameters { Device = device, Command = command, CommandType = commandType, Alternative = alternative, Timeout = timeout });
|
|
}
|
|
|
|
public static void SendCommand(this IRemoteEntityCore target, RemoteSendCommandParameters data)
|
|
{
|
|
target.CallService("send_command", data);
|
|
}
|
|
|
|
public static void SendCommand(this IEnumerable<IRemoteEntityCore> target, RemoteSendCommandParameters data)
|
|
{
|
|
target.CallService("send_command", data);
|
|
}
|
|
|
|
///<param name="target">The IRemoteEntityCore to call this service for</param>
|
|
///<param name="device"> eg: 32756745</param>
|
|
///<param name="command"> eg: Play</param>
|
|
///<param name="numRepeats"></param>
|
|
///<param name="delaySecs"></param>
|
|
///<param name="holdSecs"></param>
|
|
public static void SendCommand(this IRemoteEntityCore target, object command, string? device = null, long? numRepeats = null, double? delaySecs = null, double? holdSecs = null)
|
|
{
|
|
target.CallService("send_command", new RemoteSendCommandParameters { Device = device, Command = command, NumRepeats = numRepeats, DelaySecs = delaySecs, HoldSecs = holdSecs });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IRemoteEntityCore> to call this service for</param>
|
|
///<param name="device"> eg: 32756745</param>
|
|
///<param name="command"> eg: Play</param>
|
|
///<param name="numRepeats"></param>
|
|
///<param name="delaySecs"></param>
|
|
///<param name="holdSecs"></param>
|
|
public static void SendCommand(this IEnumerable<IRemoteEntityCore> target, object command, string? device = null, long? numRepeats = null, double? delaySecs = null, double? holdSecs = null)
|
|
{
|
|
target.CallService("send_command", new RemoteSendCommandParameters { Device = device, Command = command, NumRepeats = numRepeats, DelaySecs = delaySecs, HoldSecs = holdSecs });
|
|
}
|
|
|
|
public static void Toggle(this IRemoteEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<IRemoteEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this IRemoteEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<IRemoteEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this IRemoteEntityCore target, RemoteTurnOnParameters data)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<IRemoteEntityCore> target, RemoteTurnOnParameters data)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
///<param name="target">The IRemoteEntityCore to call this service for</param>
|
|
///<param name="activity"> eg: BedroomTV</param>
|
|
public static void TurnOn(this IRemoteEntityCore target, string? activity = null)
|
|
{
|
|
target.CallService("turn_on", new RemoteTurnOnParameters { Activity = activity });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IRemoteEntityCore> to call this service for</param>
|
|
///<param name="activity"> eg: BedroomTV</param>
|
|
public static void TurnOn(this IEnumerable<IRemoteEntityCore> target, string? activity = null)
|
|
{
|
|
target.CallService("turn_on", new RemoteTurnOnParameters { Activity = activity });
|
|
}
|
|
}
|
|
|
|
public static class ScriptEntityExtensionMethods
|
|
{
|
|
public static void Toggle(this IScriptEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<IScriptEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this IScriptEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<IScriptEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this IScriptEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<IScriptEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
}
|
|
|
|
public static class SelectEntityExtensionMethods
|
|
{
|
|
///<summary>Select an random option for a select entity.</summary>
|
|
public static void Random(this ISelectEntityCore target, SelectRandomParameters data)
|
|
{
|
|
target.CallService("random", data);
|
|
}
|
|
|
|
///<summary>Select an random option for a select entity.</summary>
|
|
public static void Random(this IEnumerable<ISelectEntityCore> target, SelectRandomParameters data)
|
|
{
|
|
target.CallService("random", data);
|
|
}
|
|
|
|
///<summary>Select an random option for a select entity.</summary>
|
|
///<param name="target">The ISelectEntityCore to call this service for</param>
|
|
///<param name="options">Limits the options to select from. If not provided, all options will be considered.</param>
|
|
public static void Random(this ISelectEntityCore target, object? options = null)
|
|
{
|
|
target.CallService("random", new SelectRandomParameters { Options = options });
|
|
}
|
|
|
|
///<summary>Select an random option for a select entity.</summary>
|
|
///<param name="target">The IEnumerable<ISelectEntityCore> to call this service for</param>
|
|
///<param name="options">Limits the options to select from. If not provided, all options will be considered.</param>
|
|
public static void Random(this IEnumerable<ISelectEntityCore> target, object? options = null)
|
|
{
|
|
target.CallService("random", new SelectRandomParameters { Options = options });
|
|
}
|
|
|
|
public static void SelectFirst(this ISelectEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("select_first", data);
|
|
}
|
|
|
|
public static void SelectFirst(this IEnumerable<ISelectEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("select_first", data);
|
|
}
|
|
|
|
public static void SelectLast(this ISelectEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("select_last", data);
|
|
}
|
|
|
|
public static void SelectLast(this IEnumerable<ISelectEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("select_last", data);
|
|
}
|
|
|
|
public static void SelectNext(this ISelectEntityCore target, SelectSelectNextParameters data)
|
|
{
|
|
target.CallService("select_next", data);
|
|
}
|
|
|
|
public static void SelectNext(this IEnumerable<ISelectEntityCore> target, SelectSelectNextParameters data)
|
|
{
|
|
target.CallService("select_next", data);
|
|
}
|
|
|
|
///<param name="target">The ISelectEntityCore to call this service for</param>
|
|
///<param name="cycle"></param>
|
|
public static void SelectNext(this ISelectEntityCore target, bool? cycle = null)
|
|
{
|
|
target.CallService("select_next", new SelectSelectNextParameters { Cycle = cycle });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<ISelectEntityCore> to call this service for</param>
|
|
///<param name="cycle"></param>
|
|
public static void SelectNext(this IEnumerable<ISelectEntityCore> target, bool? cycle = null)
|
|
{
|
|
target.CallService("select_next", new SelectSelectNextParameters { Cycle = cycle });
|
|
}
|
|
|
|
public static void SelectOption(this ISelectEntityCore target, SelectSelectOptionParameters data)
|
|
{
|
|
target.CallService("select_option", data);
|
|
}
|
|
|
|
public static void SelectOption(this IEnumerable<ISelectEntityCore> target, SelectSelectOptionParameters data)
|
|
{
|
|
target.CallService("select_option", data);
|
|
}
|
|
|
|
///<param name="target">The ISelectEntityCore to call this service for</param>
|
|
///<param name="option"> eg: "Item A"</param>
|
|
public static void SelectOption(this ISelectEntityCore target, object option)
|
|
{
|
|
target.CallService("select_option", new SelectSelectOptionParameters { Option = option });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<ISelectEntityCore> to call this service for</param>
|
|
///<param name="option"> eg: "Item A"</param>
|
|
public static void SelectOption(this IEnumerable<ISelectEntityCore> target, object option)
|
|
{
|
|
target.CallService("select_option", new SelectSelectOptionParameters { Option = option });
|
|
}
|
|
|
|
public static void SelectPrevious(this ISelectEntityCore target, SelectSelectPreviousParameters data)
|
|
{
|
|
target.CallService("select_previous", data);
|
|
}
|
|
|
|
public static void SelectPrevious(this IEnumerable<ISelectEntityCore> target, SelectSelectPreviousParameters data)
|
|
{
|
|
target.CallService("select_previous", data);
|
|
}
|
|
|
|
///<param name="target">The ISelectEntityCore to call this service for</param>
|
|
///<param name="cycle"></param>
|
|
public static void SelectPrevious(this ISelectEntityCore target, bool? cycle = null)
|
|
{
|
|
target.CallService("select_previous", new SelectSelectPreviousParameters { Cycle = cycle });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<ISelectEntityCore> to call this service for</param>
|
|
///<param name="cycle"></param>
|
|
public static void SelectPrevious(this IEnumerable<ISelectEntityCore> target, bool? cycle = null)
|
|
{
|
|
target.CallService("select_previous", new SelectSelectPreviousParameters { Cycle = cycle });
|
|
}
|
|
}
|
|
|
|
public static class SwitchEntityExtensionMethods
|
|
{
|
|
public static void Toggle(this ISwitchEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void Toggle(this IEnumerable<ISwitchEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("toggle", data);
|
|
}
|
|
|
|
public static void TurnOff(this ISwitchEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOff(this IEnumerable<ISwitchEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_off", data);
|
|
}
|
|
|
|
public static void TurnOn(this ISwitchEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
|
|
public static void TurnOn(this IEnumerable<ISwitchEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("turn_on", data);
|
|
}
|
|
}
|
|
|
|
public static class TextEntityExtensionMethods
|
|
{
|
|
public static void SetValue(this TextEntity target, TextSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
public static void SetValue(this IEnumerable<TextEntity> target, TextSetValueParameters data)
|
|
{
|
|
target.CallService("set_value", data);
|
|
}
|
|
|
|
///<param name="target">The TextEntity to call this service for</param>
|
|
///<param name="value"> eg: Hello world!</param>
|
|
public static void SetValue(this TextEntity target, string value)
|
|
{
|
|
target.CallService("set_value", new TextSetValueParameters { Value = value });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<TextEntity> to call this service for</param>
|
|
///<param name="value"> eg: Hello world!</param>
|
|
public static void SetValue(this IEnumerable<TextEntity> target, string value)
|
|
{
|
|
target.CallService("set_value", new TextSetValueParameters { Value = value });
|
|
}
|
|
}
|
|
|
|
public static class TtsEntityExtensionMethods
|
|
{
|
|
public static void Speak(this TtsEntity target, TtsSpeakParameters data)
|
|
{
|
|
target.CallService("speak", data);
|
|
}
|
|
|
|
public static void Speak(this IEnumerable<TtsEntity> target, TtsSpeakParameters data)
|
|
{
|
|
target.CallService("speak", data);
|
|
}
|
|
|
|
///<param name="target">The TtsEntity to call this service for</param>
|
|
///<param name="mediaPlayerEntityId"></param>
|
|
///<param name="message"> eg: My name is hanna</param>
|
|
///<param name="cache"></param>
|
|
///<param name="language"> eg: ru</param>
|
|
///<param name="options"> eg: platform specific</param>
|
|
public static void Speak(this TtsEntity target, string mediaPlayerEntityId, string message, bool? cache = null, string? language = null, object? options = null)
|
|
{
|
|
target.CallService("speak", new TtsSpeakParameters { MediaPlayerEntityId = mediaPlayerEntityId, Message = message, Cache = cache, Language = language, Options = options });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<TtsEntity> to call this service for</param>
|
|
///<param name="mediaPlayerEntityId"></param>
|
|
///<param name="message"> eg: My name is hanna</param>
|
|
///<param name="cache"></param>
|
|
///<param name="language"> eg: ru</param>
|
|
///<param name="options"> eg: platform specific</param>
|
|
public static void Speak(this IEnumerable<TtsEntity> target, string mediaPlayerEntityId, string message, bool? cache = null, string? language = null, object? options = null)
|
|
{
|
|
target.CallService("speak", new TtsSpeakParameters { MediaPlayerEntityId = mediaPlayerEntityId, Message = message, Cache = cache, Language = language, Options = options });
|
|
}
|
|
}
|
|
|
|
public static class UpdateEntityExtensionMethods
|
|
{
|
|
public static void ClearSkipped(this IUpdateEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("clear_skipped", data);
|
|
}
|
|
|
|
public static void ClearSkipped(this IEnumerable<IUpdateEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("clear_skipped", data);
|
|
}
|
|
|
|
public static void Install(this IUpdateEntityCore target, UpdateInstallParameters data)
|
|
{
|
|
target.CallService("install", data);
|
|
}
|
|
|
|
public static void Install(this IEnumerable<IUpdateEntityCore> target, UpdateInstallParameters data)
|
|
{
|
|
target.CallService("install", data);
|
|
}
|
|
|
|
///<param name="target">The IUpdateEntityCore to call this service for</param>
|
|
///<param name="version"> eg: 1.0.0</param>
|
|
///<param name="backup"></param>
|
|
public static void Install(this IUpdateEntityCore target, string? version = null, bool? backup = null)
|
|
{
|
|
target.CallService("install", new UpdateInstallParameters { Version = version, Backup = backup });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IUpdateEntityCore> to call this service for</param>
|
|
///<param name="version"> eg: 1.0.0</param>
|
|
///<param name="backup"></param>
|
|
public static void Install(this IEnumerable<IUpdateEntityCore> target, string? version = null, bool? backup = null)
|
|
{
|
|
target.CallService("install", new UpdateInstallParameters { Version = version, Backup = backup });
|
|
}
|
|
|
|
public static void Skip(this IUpdateEntityCore target, object? data = null)
|
|
{
|
|
target.CallService("skip", data);
|
|
}
|
|
|
|
public static void Skip(this IEnumerable<IUpdateEntityCore> target, object? data = null)
|
|
{
|
|
target.CallService("skip", data);
|
|
}
|
|
}
|
|
|
|
public static class WeatherEntityExtensionMethods
|
|
{
|
|
public static Task<JsonElement?> GetForecastsAsync(this IWeatherEntityCore target, WeatherGetForecastsParameters data)
|
|
{
|
|
return target.CallServiceWithResponseAsync("get_forecasts", data);
|
|
}
|
|
|
|
///<param name="target">The IWeatherEntityCore to call this service for</param>
|
|
///<param name="type"></param>
|
|
public static Task<JsonElement?> GetForecastsAsync(this IWeatherEntityCore target, object @type)
|
|
{
|
|
return target.CallServiceWithResponseAsync("get_forecasts", new WeatherGetForecastsParameters { Type = @type });
|
|
}
|
|
|
|
public static void GetForecasts(this IWeatherEntityCore target, WeatherGetForecastsParameters data)
|
|
{
|
|
target.CallService("get_forecasts", data);
|
|
}
|
|
|
|
public static void GetForecasts(this IEnumerable<IWeatherEntityCore> target, WeatherGetForecastsParameters data)
|
|
{
|
|
target.CallService("get_forecasts", data);
|
|
}
|
|
|
|
///<param name="target">The IWeatherEntityCore to call this service for</param>
|
|
///<param name="type"></param>
|
|
public static void GetForecasts(this IWeatherEntityCore target, object @type)
|
|
{
|
|
target.CallService("get_forecasts", new WeatherGetForecastsParameters { Type = @type });
|
|
}
|
|
|
|
///<param name="target">The IEnumerable<IWeatherEntityCore> to call this service for</param>
|
|
///<param name="type"></param>
|
|
public static void GetForecasts(this IEnumerable<IWeatherEntityCore> target, object @type)
|
|
{
|
|
target.CallService("get_forecasts", new WeatherGetForecastsParameters { Type = @type });
|
|
}
|
|
} |