Skip to content

Commit

Permalink
Use first selected sensor id of the plot widget. CodeforKarlsruhe#12
Browse files Browse the repository at this point in the history
  • Loading branch information
dbaelz committed Dec 30, 2017
1 parent dee0959 commit bbda756
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ object WidgetHelper {

internal fun getSensorHistory(context: Context, appWidgetId: Int): Single<List<SensorHistory>> {
val boxId = loadBoxId(context, appWidgetId)
// TODO make configurable, the following line crashes
//val sensorId = loadSensorIds(context, appWidgetId).first()
val sensorId = "59c67b5ed67eb50011666dc0"
// We keep it really simple here and just use the first selected sensor of this widget
val sensorId = loadSensorIds(context, appWidgetId).firstOrNull() ?: return Single.just(emptyList())

Log.i("WidgetHelper", "getSensorHistory() boxId: $boxId, sensorId: $sensorId")
return getSensorHistory(boxId, sensorId)
}
Expand Down

0 comments on commit bbda756

Please sign in to comment.