public static IDictionary <string, LogicValuePayload> GetLogicStates(long referenceId) { var logicable = OcclusionManager.AllThings.Find(x => x.ReferenceId == referenceId) as ILogicable; if (logicable == null) { return(null); } return(LogicableItemUtils.GetLogicValues(logicable)); }
public async Task GetAllLogicValues(IHttpContext context, long referenceId) { Authenticator.VerifyAuth(context); var device = await Dispatcher.RunOnMainThread(() => Device.AllDevices.Find(x => x.ReferenceId == referenceId)); if (device == null) { throw new NotFoundException("Device not found."); } await context.SendResponse(HttpStatusCode.OK, LogicableItemUtils.GetLogicValues(device)); }