Update sensors when BLE transmitter turned on and off (#3385)

* Update sensors when BLE transmitter turned on and off

* Remove duplicate code
This commit is contained in:
Daniel Shokouhi 2023-03-08 07:06:55 -08:00 committed by GitHub
parent aaef25497d
commit deb3d84ab7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 6 deletions

View file

@ -164,8 +164,8 @@ fun commandBleTransmitter(
null
)
}
BluetoothSensorManager().requestSensorUpdate(context)
SensorUpdateReceiver.updateSensors(context)
}
BluetoothSensorManager().requestSensorUpdate(context)
SensorUpdateReceiver.updateSensors(context)
return true
}

View file

@ -108,10 +108,6 @@ class BluetoothSensorManager : SensorManager {
return
}
TransmitterManager.stopTransmitting(bleTransmitterDevice) // stop in all instances, clean up state if start required
if (transmitEnabled) {
TransmitterManager.startTransmitting(context, bleTransmitterDevice)
}
sensorDao.add(SensorSetting(bleTransmitter.id, SETTING_BLE_TRANSMIT_ENABLED, transmitEnabled.toString(), SensorSettingType.TOGGLE))
}