Skip to content

Commit

Permalink
feat: Adds new messengers to SetupDefaultDeviceMessengers
Browse files Browse the repository at this point in the history
  • Loading branch information
ndorin committed Sep 13, 2024
1 parent 37a3db3 commit 64f62a5
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions 3-series/MobileControlSystemController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,46 @@ device as IHasCurrentSourceInfoChange
messengerAdded = true;
}

if (device is ITemperatureSensor tempSensor)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Verbose,
"Adding ITemperatureSensor for device: {key}",
this,
device.Key
);

var messenger = new ITemperatureSensorMessenger(
$"{device.Key}-tempSensor",
tempSensor,
$"/device/{device.Key}"
);

AddDefaultDeviceMessenger(messenger);

messengerAdded = true;
}

if (device is IHumiditySensor humSensor)
{
Debug.LogMessage(
Serilog.Events.LogEventLevel.Verbose,
"Adding IHumiditySensor for device: {key}",
this,
device.Key
);

var messenger = new IHumiditySensorMessenger(
$"{device.Key}-humiditySensor",
humSensor,
$"/device/{device.Key}"
);

AddDefaultDeviceMessenger(messenger);

messengerAdded = true;
}

if (device is IEssentialsRoomCombiner roomCombiner)
{
Debug.Console(
Expand Down

0 comments on commit 64f62a5

Please sign in to comment.