コード例 #1
0
        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));
        }
コード例 #2
0
        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));
        }