mirror of
https://github.com/home-assistant/android
synced 2024-07-22 10:54:12 +00:00
Fix last update sensor intent not retrieving value (#3825)
* Fix last update sensor intent not retrieving value * Suppress deprecation * Move suppression
This commit is contained in:
parent
bb58a578dd
commit
3cc7bdca08
|
@ -109,15 +109,14 @@ abstract class SensorReceiverBase : BroadcastReceiver() {
|
|||
return
|
||||
}
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
if (isSensorEnabled(LastUpdateManager.lastUpdate.id)) {
|
||||
LastUpdateManager().sendLastUpdate(context, intent.action)
|
||||
val allSettings = sensorDao.getSettings(LastUpdateManager.lastUpdate.id)
|
||||
for (setting in allSettings) {
|
||||
if (setting.value != "" && intent.action == setting.value) {
|
||||
val eventData = intent.extras?.keySet()
|
||||
?.associate {
|
||||
it.toString() to (intent.extras?.getString(it) ?: "")
|
||||
}
|
||||
?.associate { it.toString() to intent.extras?.get(it).toString() }
|
||||
?.plus("intent" to intent.action.toString())
|
||||
?: mapOf("intent" to intent.action.toString())
|
||||
Log.d(tag, "Event data: $eventData")
|
||||
|
|
Loading…
Reference in a new issue