Skip to content

Commit

Permalink
fix office routine
Browse files Browse the repository at this point in the history
  • Loading branch information
dteske25 committed Jan 24, 2024
1 parent 63bbe66 commit c69e9d3
Show file tree
Hide file tree
Showing 5 changed files with 717 additions and 648 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"netdaemon.hassmodel.codegen": {
"version": "23.46.1",
"version": "24.3.1",
"commands": [
"nd-codegen"
]
Expand Down
51 changes: 49 additions & 2 deletions HomeAssistantGenerated.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Generated using NetDaemon CodeGenerator nd-codegen v23.46.1.0
// At: 2024-01-16T23:07:26.8647136-06:00
// Generated using NetDaemon CodeGenerator nd-codegen v24.3.1.0
// At: 2024-01-23T23:15:46.7708100-06:00
//
// *** Make sure the version of the codegen tool and your nugets Joysoftware.NetDaemon.* have the same version.***
// You can use following command to keep it up to date with the latest version:
Expand All @@ -19,6 +19,7 @@
//------------------------------------------------------------------------------
#nullable enable
using System;
using System.Linq;
using System.Collections.Generic;
using Microsoft.Extensions.DependencyInjection;
using System.Text.Json.Serialization;
Expand Down Expand Up @@ -172,6 +173,8 @@ 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>Closet Sensor Motion</summary>
public BinarySensorEntity ClosetSensorMotion => new(_haContext, "binary_sensor.closet_sensor_motion");
///<summary>dteske-pixel High accuracy mode</summary>
Expand All @@ -198,8 +201,12 @@ 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>Bedroom Button Identify</summary>
public ButtonEntity BedroomButtonIdentify => new(_haContext, "button.bedroom_button_identify");
///<summary>Elements AC4B Identify</summary>
public ButtonEntity ElementsAc4bIdentify => new(_haContext, "button.elements_ac4b_identify");
///<summary>Living Room Button Identify</summary>
public ButtonEntity LivingRoomButtonIdentify => new(_haContext, "button.living_room_button_identify");
///<summary>Motion Sensor 2 Identify</summary>
Expand All @@ -220,6 +227,8 @@ public ButtonEntities(IHaContext haContext)
public ButtonEntity Outlet5Identify => new(_haContext, "button.outlet_5_identify");
///<summary>Outlet 6 Identify</summary>
public ButtonEntity Outlet6Identify => new(_haContext, "button.outlet_6_identify");
///<summary>Shapes 7B48 Identify</summary>
public ButtonEntity Shapes7b48Identify => new(_haContext, "button.shapes_7b48_identify");
}

public partial class CoverEntities
Expand All @@ -230,6 +239,8 @@ public CoverEntities(IHaContext haContext)
_haContext = haContext;
}

/// <summary>Enumerates all cover entities currently registered (at runtime) in Home Assistant as CoverEntity</summary>
public IEnumerable<CoverEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("cover.")).Select(e => new CoverEntity(e));
///<summary>Daric&apos;s Garage Door</summary>
public CoverEntity DaricsGarageDoor2 => new(_haContext, "cover.darics_garage_door_2");
///<summary>Megan&apos;s Garage Door</summary>
Expand All @@ -244,6 +255,8 @@ 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>dteske-pixel</summary>
public DeviceTrackerEntity DteskePixel => new(_haContext, "device_tracker.dteske_pixel");
///<summary>meg</summary>
Expand All @@ -258,6 +271,8 @@ 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>netdaemon_teske_home_assistant_apps_alarm_light_schedule</summary>
public InputBooleanEntity NetdaemonTeskeHomeAssistantAppsAlarmLightSchedule => new(_haContext, "input_boolean.netdaemon_teske_home_assistant_apps_alarm_light_schedule");
///<summary>netdaemon_teske_home_assistant_apps_bedroom_automation</summary>
Expand All @@ -276,6 +291,8 @@ 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>Basement Living Room</summary>
public LightEntity BasementLivingRoom => new(_haContext, "light.basement_living_room");
///<summary>Basement Wall Accent</summary>
Expand All @@ -294,12 +311,16 @@ public LightEntities(IHaContext haContext)
public LightEntity BedroomLamp => new(_haContext, "light.bedroom_lamp");
///<summary>Bedroom Lamp 2</summary>
public LightEntity BedroomLamp2 => new(_haContext, "light.bedroom_lamp_2");
///<summary>Elements AC4B</summary>
public LightEntity ElementsAc4b => new(_haContext, "light.elements_ac4b");
///<summary>Hue Bloom</summary>
public LightEntity HueBloom => new(_haContext, "light.hue_bloom");
///<summary>Hue Bloom 2</summary>
public LightEntity HueBloom2 => new(_haContext, "light.hue_bloom_2");
///<summary>Office Lights</summary>
public LightEntity OfficeLights => new(_haContext, "light.office_lights");
///<summary>Shapes 7B48</summary>
public LightEntity Shapes7b48 => new(_haContext, "light.shapes_7b48");
}

public partial class MediaPlayerEntities
Expand All @@ -310,6 +331,8 @@ 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));
///<summary>Bedroom clock</summary>
public MediaPlayerEntity BedroomClock => new(_haContext, "media_player.bedroom_clock");
///<summary>Office display</summary>
Expand All @@ -326,6 +349,8 @@ 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>Daric Teske</summary>
public PersonEntity DaricTeske => new(_haContext, "person.daric_teske");
///<summary>Megan Mayfield</summary>
Expand All @@ -340,6 +365,8 @@ public SceneEntities(IHaContext haContext)
_haContext = haContext;
}

/// <summary>Enumerates all scene entities currently registered (at runtime) in Home Assistant as SceneEntity</summary>
public IEnumerable<SceneEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("scene.")).Select(e => new SceneEntity(e));
///<summary>Bedroom Bright</summary>
public SceneEntity BedroomBright => new(_haContext, "scene.bedroom_bright");
///<summary>Bedroom Read</summary>
Expand Down Expand Up @@ -390,6 +417,12 @@ 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>dteske-pixel Battery state</summary>
public SensorEntity DteskePixelBatteryState => new(_haContext, "sensor.dteske_pixel_battery_state");
///<summary>dteske-pixel Charger type</summary>
Expand Down Expand Up @@ -492,6 +525,8 @@ 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");
}
Expand All @@ -504,6 +539,8 @@ 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>Closet Sensor Light sensor enabled</summary>
public SwitchEntity ClosetSensorLightSensorEnabled => new(_haContext, "switch.closet_sensor_light_sensor_enabled");
///<summary>Closet Sensor Motion sensor enabled</summary>
Expand Down Expand Up @@ -538,6 +575,8 @@ 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>Home</summary>
public WeatherEntity Home => new(_haContext, "weather.home");
}
Expand All @@ -550,6 +589,8 @@ 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>teske-home</summary>
public ZoneEntity Home => new(_haContext, "zone.home");
}
Expand All @@ -562,6 +603,8 @@ public CameraEntities(IHaContext haContext)
_haContext = haContext;
}

/// <summary>Enumerates all camera entities currently registered (at runtime) in Home Assistant as CameraEntity</summary>
public IEnumerable<CameraEntity> EnumerateAll() => _haContext.GetAllEntities().Where(e => e.EntityId.StartsWith("camera.")).Select(e => new CameraEntity(e));
///<summary>Backyard camera</summary>
public CameraEntity BackyardCamera => new(_haContext, "camera.backyard_camera");
///<summary>Front yard camera</summary>
Expand All @@ -580,6 +623,8 @@ 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>Hallway Thermostat</summary>
public ClimateEntity HallwayThermostat => new(_haContext, "climate.hallway_thermostat");
}
Expand All @@ -592,6 +637,8 @@ 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 en com</summary>
public TtsEntity GoogleEnCom => new(_haContext, "tts.google_en_com");
}
Expand Down
20 changes: 20 additions & 0 deletions NetDaemonCodegen/EntityMetaData.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,11 @@
"friendlyName": "Bedroom Button Identify",
"cSharpName": "BedroomButtonIdentify"
},
{
"id": "button.elements_ac4b_identify",
"friendlyName": "Elements AC4B Identify",
"cSharpName": "ElementsAc4bIdentify"
},
{
"id": "button.living_room_button_identify",
"friendlyName": "Living Room Button Identify",
Expand Down Expand Up @@ -129,6 +134,11 @@
"id": "button.outlet_6_identify",
"friendlyName": "Outlet 6 Identify",
"cSharpName": "Outlet6Identify"
},
{
"id": "button.shapes_7b48_identify",
"friendlyName": "Shapes 7B48 Identify",
"cSharpName": "Shapes7b48Identify"
}
],
"attributes": [
Expand Down Expand Up @@ -333,6 +343,11 @@
"friendlyName": "Bedroom Lamp 2",
"cSharpName": "BedroomLamp2"
},
{
"id": "light.elements_ac4b",
"friendlyName": "Elements AC4B",
"cSharpName": "ElementsAc4b"
},
{
"id": "light.hue_bloom",
"friendlyName": "Hue Bloom",
Expand All @@ -347,6 +362,11 @@
"id": "light.office_lights",
"friendlyName": "Office Lights",
"cSharpName": "OfficeLights"
},
{
"id": "light.shapes_7b48",
"friendlyName": "Shapes 7B48",
"cSharpName": "Shapes7b48"
}
],
"attributes": [
Expand Down
Loading

0 comments on commit c69e9d3

Please sign in to comment.