mirror of
https://github.com/home-assistant/android
synced 2024-10-04 15:19:30 +00:00
Add update sensors notification command to Wear OS (#3774)
This commit is contained in:
parent
eb195b6687
commit
256835a380
|
@ -154,7 +154,6 @@ class MessagingManager @Inject constructor(
|
|||
const val COMMAND_BLUETOOTH = "command_bluetooth"
|
||||
const val COMMAND_SCREEN_ON = "command_screen_on"
|
||||
const val COMMAND_MEDIA = "command_media"
|
||||
const val COMMAND_UPDATE_SENSORS = "command_update_sensors"
|
||||
const val COMMAND_HIGH_ACCURACY_MODE = "command_high_accuracy_mode"
|
||||
const val COMMAND_ACTIVITY = "command_activity"
|
||||
const val COMMAND_WEBVIEW = "command_webview"
|
||||
|
@ -213,7 +212,7 @@ class MessagingManager @Inject constructor(
|
|||
COMMAND_WEBVIEW,
|
||||
COMMAND_SCREEN_ON,
|
||||
COMMAND_MEDIA,
|
||||
COMMAND_UPDATE_SENSORS,
|
||||
DeviceCommandData.COMMAND_UPDATE_SENSORS,
|
||||
COMMAND_LAUNCH_APP,
|
||||
COMMAND_APP_LOCK,
|
||||
COMMAND_PERSISTENT_CONNECTION,
|
||||
|
@ -477,7 +476,7 @@ class MessagingManager @Inject constructor(
|
|||
sendNotification(jsonData)
|
||||
}
|
||||
}
|
||||
COMMAND_UPDATE_SENSORS -> SensorReceiver.updateAllSensors(context)
|
||||
DeviceCommandData.COMMAND_UPDATE_SENSORS -> SensorReceiver.updateAllSensors(context)
|
||||
COMMAND_LAUNCH_APP -> {
|
||||
if (!jsonData[PACKAGE_NAME].isNullOrEmpty()) {
|
||||
handleDeviceCommands(jsonData)
|
||||
|
|
|
@ -13,6 +13,7 @@ object DeviceCommandData {
|
|||
|
||||
const val COMMAND_BEACON_MONITOR = "command_beacon_monitor"
|
||||
const val COMMAND_BLE_TRANSMITTER = "command_ble_transmitter"
|
||||
const val COMMAND_UPDATE_SENSORS = "command_update_sensors"
|
||||
|
||||
// Enable/Disable Commands
|
||||
const val TURN_ON = "turn_on"
|
||||
|
|
|
@ -23,6 +23,7 @@ import io.homeassistant.companion.android.common.util.stopTTS
|
|||
import io.homeassistant.companion.android.database.AppDatabase
|
||||
import io.homeassistant.companion.android.database.notification.NotificationItem
|
||||
import io.homeassistant.companion.android.database.sensor.SensorDao
|
||||
import io.homeassistant.companion.android.sensors.SensorReceiver
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
import kotlinx.coroutines.Job
|
||||
|
@ -71,6 +72,7 @@ class MessagingManager @Inject constructor(
|
|||
}
|
||||
message == TextToSpeechData.TTS -> speakText(context, notificationData)
|
||||
message == TextToSpeechData.COMMAND_STOP_TTS -> stopTTS()
|
||||
message == DeviceCommandData.COMMAND_UPDATE_SENSORS -> SensorReceiver.updateAllSensors(context)
|
||||
else -> sendNotification(notificationData, now)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue