@ -157,7 +157,7 @@ namespace hass_workstation_service.Data
break ;
break ;
// keep this one last!
// keep this one last!
case "WMIQuerySensor" :
case "WMIQuerySensor" :
sensor = new WMIQuerySensor ( publisher , configuredSensor . Query , configuredSensor . UpdateInterval , configuredSensor . Name , configuredSensor . Id );
sensor = new WMIQuerySensor ( publisher , configuredSensor . Query , configuredSensor . UpdateInterval , configuredSensor . Name , configuredSensor . Id , configuredSensor . Scope );
break ;
break ;
default :
default :
Log . Logger . Error ( "unsupported sensor type in config" ) ;
Log . Logger . Error ( "unsupported sensor type in config" ) ;
@ -210,22 +210,22 @@ namespace hass_workstation_service.Data
case "CustomCommand" :
case "CustomCommand" :
command = new CustomCommand ( publisher , configuredCommand . Command , configuredCommand . Name , configuredCommand . Id ) ;
command = new CustomCommand ( publisher , configuredCommand . Command , configuredCommand . Name , configuredCommand . Id ) ;
break ;
break ;
case " Media PlayPauseCommand":
case " PlayPauseCommand":
command = new PlayPauseCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
command = new PlayPauseCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
break ;
break ;
case " Media NextCommand":
case " NextCommand":
command = new NextCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
command = new NextCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
break ;
break ;
case " Media PreviousCommand":
case " PreviousCommand":
command = new PreviousCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
command = new PreviousCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
break ;
break ;
case " Media VolumeUpCommand":
case " VolumeUpCommand":
command = new VolumeUpCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
command = new VolumeUpCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
break ;
break ;
case " Media VolumeDownCommand":
case " VolumeDownCommand":
command = new VolumeDownCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
command = new VolumeDownCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
break ;
break ;
case "M ediaM uteCommand":
case "M uteCommand":
command = new MuteCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
command = new MuteCommand ( publisher , configuredCommand . Name , configuredCommand . Id ) ;
break ;
break ;
case "KeyCommand" :
case "KeyCommand" :
@ -412,7 +412,7 @@ namespace hass_workstation_service.Data
if ( sensor is WMIQuerySensor wmiSensor )
if ( sensor is WMIQuerySensor wmiSensor )
{
{
#pragma warning disable CA1416 // Validate platform compatibility. We ignore it here because this would never happen. A cleaner solution may be implemented later.
#pragma warning disable CA1416 // Validate platform compatibility. We ignore it here because this would never happen. A cleaner solution may be implemented later.
configuredSensorsToSave . Add ( new ConfiguredSensor ( ) { Id = wmiSensor . Id , Name = wmiSensor . Name , Type = wmiSensor . GetType ( ) . Name , UpdateInterval = wmiSensor . UpdateInterval , Query = wmiSensor . Query } ) ;
configuredSensorsToSave . Add ( new ConfiguredSensor ( ) { Id = wmiSensor . Id , Name = wmiSensor . Name , Type = wmiSensor . GetType ( ) . Name , UpdateInterval = wmiSensor . UpdateInterval , Query = wmiSensor . Query , Scope = wmiSensor . Scope } ) ;
#pragma warning restore CA1416 // Validate platform compatibility
#pragma warning restore CA1416 // Validate platform compatibility
}
}
else if ( sensor is NamedWindowSensor namedWindowSensor )
else if ( sensor is NamedWindowSensor namedWindowSensor )