public void onEvent(object sender, MeasuredValueChange value)
 {
     if (value.MeasureName == "indoorSensor")
     {
         if (value.SpaceID == this.spaceID)
         {
             setState(value.NewValue == 1);
         }
     }
 }
 public async void onEvent(object sender, MeasuredValueChange value)
 {
     try
     {
         {
             await client.addMeasure(value.MeasureName, value.SpaceID, value.NewValue);
         }
     }
     catch (Exception err)
     {
         log.Error($"Error occure during sent data to DB. Device: {value.DeviceID}");
         log.Error(err);
     }
 }
        public async void onEvent(object sender, MeasuredValueChange value)
        {
            try
            {
                {
                    var successfull = await client.addMeasure(value.MeasureName, value.SpaceID, value.NewValue);

                    if (!successfull)
                    {
                        log.Warn($"Something went wrong during sent data to DB. Device: {value.DeviceID}");
                    }
                }
            }
            catch (Exception err)
            {
                log.Error($"Error occure during sent data to DB. Device: {value.DeviceID}");
                log.Error(err);
            }
        }
 private void OnValueChanged(MeasuredValueChange value)
 {
     ValueChanged?.Invoke(this, value);
 }