mirror of
https://bitbucket.org/myhomie/mycorerepository.git
synced 2025-12-06 09:41:19 +00:00
MC clean code
This commit is contained in:
parent
63ae265446
commit
bfc51d4aca
@ -104,23 +104,23 @@ namespace MyCore.Services.Devices
|
|||||||
switch (action.Type)
|
switch (action.Type)
|
||||||
{
|
{
|
||||||
case ActionType.DEVICE:
|
case ActionType.DEVICE:
|
||||||
var zigbeeDeviceAction = _DeviceDatabaseService.GetById(action.DeviceId);
|
var deviceAction = _DeviceDatabaseService.GetById(action.DeviceId);
|
||||||
var providerActionTest = _ProviderDatabaseService.GetById(userId, action.ProviderId);
|
var providerActionTest = _ProviderDatabaseService.GetById(userId, action.ProviderId);
|
||||||
|
|
||||||
DeviceNameForAction = zigbeeDeviceAction.Name;
|
DeviceNameForAction = deviceAction.Name;
|
||||||
actionDeviceToTest = zigbeeDeviceAction;
|
actionDeviceToTest = deviceAction;
|
||||||
System.Console.WriteLine($"We get a zigbeeDeviceAction ! Name={zigbeeDeviceAction.Name} Type={zigbeeDeviceAction.Type}");
|
System.Console.WriteLine($"We get a device action ! Name={deviceAction.Name} Type={deviceAction.Type}");
|
||||||
System.Console.WriteLine($"Check action provider type ! Type={providerActionTest.Type} Name={providerActionTest.Name}");
|
System.Console.WriteLine($"Check action provider type ! Type={providerActionTest.Type} Name={providerActionTest.Name}");
|
||||||
break;
|
break;
|
||||||
case ActionType.GROUP:
|
case ActionType.GROUP:
|
||||||
var zigbeeGroupAction = _GroupDatabaseService.GetById(action.GroupId);
|
var groupAction = _GroupDatabaseService.GetById(action.GroupId);
|
||||||
DeviceNameForAction = zigbeeGroupAction.Name;
|
DeviceNameForAction = groupAction.Name;
|
||||||
|
|
||||||
System.Console.WriteLine($"We get a zigbeeGroupAction ! Name={zigbeeGroupAction.Name} Type={zigbeeGroupAction.Type}");
|
System.Console.WriteLine($"We get a group action ! Name={groupAction.Name} Type={groupAction.Type}");
|
||||||
System.Console.WriteLine($"Check action zigbeeGroupAction type ! Type={zigbeeGroupAction.Type}");
|
System.Console.WriteLine($"Check action zigbeeGroupAction type ! Type={groupAction.Type}");
|
||||||
|
|
||||||
// Check state of first device of a group
|
// Check state of first device of a group
|
||||||
actionDeviceToTest = _DeviceDatabaseService.GetByGroup(zigbeeGroupAction.Id).FirstOrDefault(); // TODO : Send error if no device found !
|
actionDeviceToTest = _DeviceDatabaseService.GetByGroup(groupAction.Id).FirstOrDefault(); // TODO : Send error if no device found !
|
||||||
break;
|
break;
|
||||||
case ActionType.MQTT:
|
case ActionType.MQTT:
|
||||||
// take raw request and send it !
|
// take raw request and send it !
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user