From bfbd0660738fd455fd53ad2c0c983b49a76f1c67 Mon Sep 17 00:00:00 2001 From: Michael Rudolph Date: Tue, 24 Jul 2018 23:11:17 +0200 Subject: [PATCH] Clean ups --- src/main/java/io/rudolph/netatmo/NetatmoApi.kt | 2 +- .../java/io/rudolph/netatmo/api/aircare/AirCareConnector.kt | 2 +- .../netatmo/api/common/model/MeasureRequestResponse.kt | 2 +- .../io/rudolph/netatmo/api/common/service/CommonService.kt | 2 +- .../netatmo/api/common/transform/JacksonTransform.kt | 6 +++--- .../io/rudolph/netatmo/api/energy/service/EnergyService.kt | 3 +-- .../java/io/rudolph/netatmo/api/weather/WeatherConnector.kt | 2 +- .../api/weather/model/transform/MeasureDeserializer.kt | 2 +- .../netatmo/oauth2/networkinterceptor/AuthInterceptor.kt | 2 +- 9 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/rudolph/netatmo/NetatmoApi.kt b/src/main/java/io/rudolph/netatmo/NetatmoApi.kt index cb75adf..c13e0a2 100644 --- a/src/main/java/io/rudolph/netatmo/NetatmoApi.kt +++ b/src/main/java/io/rudolph/netatmo/NetatmoApi.kt @@ -2,13 +2,13 @@ package io.rudolph.netatmo import com.jakewharton.retrofit2.adapter.kotlin.coroutines.experimental.CoroutineCallAdapterFactory import io.rudolph.netatmo.api.aircare.AirCareConnector +import io.rudolph.netatmo.api.common.transform.JacksonTransform import io.rudolph.netatmo.api.energy.EnergyConnector import io.rudolph.netatmo.api.weather.WeatherConnector import io.rudolph.netatmo.oauth2.TokenStorage import io.rudolph.netatmo.oauth2.model.Scope import io.rudolph.netatmo.oauth2.networkinterceptor.AuthInterceptor import io.rudolph.netatmo.oauth2.networkinterceptor.TimeoutInterceptor -import io.rudolph.netatmo.api.common.transform.JacksonTransform import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor import retrofit2.Retrofit diff --git a/src/main/java/io/rudolph/netatmo/api/aircare/AirCareConnector.kt b/src/main/java/io/rudolph/netatmo/api/aircare/AirCareConnector.kt index 6bd13db..f08998c 100644 --- a/src/main/java/io/rudolph/netatmo/api/aircare/AirCareConnector.kt +++ b/src/main/java/io/rudolph/netatmo/api/aircare/AirCareConnector.kt @@ -7,7 +7,7 @@ import io.rudolph.netatmo.api.energy.model.TypedBaseResult import io.rudolph.netatmo.executable.Executable import retrofit2.Retrofit -class AirCareConnector(api: Retrofit): CommonConnector(api) { +class AirCareConnector(api: Retrofit) : CommonConnector(api) { private val airCareService = api.create(AirCareService::class.java) diff --git a/src/main/java/io/rudolph/netatmo/api/common/model/MeasureRequestResponse.kt b/src/main/java/io/rudolph/netatmo/api/common/model/MeasureRequestResponse.kt index 54e32f5..a7eb06c 100644 --- a/src/main/java/io/rudolph/netatmo/api/common/model/MeasureRequestResponse.kt +++ b/src/main/java/io/rudolph/netatmo/api/common/model/MeasureRequestResponse.kt @@ -11,5 +11,5 @@ data class MeasureRequestResponse( val stepTime: LocalDateTime, @JsonProperty("value") - val value: MutableList>?= mutableListOf>() + val value: MutableList>? = mutableListOf>() ) \ No newline at end of file diff --git a/src/main/java/io/rudolph/netatmo/api/common/service/CommonService.kt b/src/main/java/io/rudolph/netatmo/api/common/service/CommonService.kt index c8b184d..fc6672f 100644 --- a/src/main/java/io/rudolph/netatmo/api/common/service/CommonService.kt +++ b/src/main/java/io/rudolph/netatmo/api/common/service/CommonService.kt @@ -22,5 +22,5 @@ interface CommonService { @Query("limit") limit: Int? = null, @Query("optimize") optimize: Boolean? = null, @Query("real_time") realTime: String? = null - ): Call>> + ): Call>> } \ No newline at end of file diff --git a/src/main/java/io/rudolph/netatmo/api/common/transform/JacksonTransform.kt b/src/main/java/io/rudolph/netatmo/api/common/transform/JacksonTransform.kt index ea2210a..65162ea 100644 --- a/src/main/java/io/rudolph/netatmo/api/common/transform/JacksonTransform.kt +++ b/src/main/java/io/rudolph/netatmo/api/common/transform/JacksonTransform.kt @@ -4,6 +4,9 @@ import com.fasterxml.jackson.databind.DeserializationFeature import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.module.SimpleModule import com.fasterxml.jackson.module.kotlin.registerKotlinModule +import io.rudolph.netatmo.api.common.model.DeviceType +import io.rudolph.netatmo.api.common.model.Scale +import io.rudolph.netatmo.api.common.model.ScaleType import io.rudolph.netatmo.api.energy.model.TemperatureType import io.rudolph.netatmo.api.energy.model.ThermMode import io.rudolph.netatmo.api.energy.model.ZoneType @@ -11,9 +14,6 @@ import io.rudolph.netatmo.api.energy.model.transform.TemperaturTypeDeserializer import io.rudolph.netatmo.api.energy.model.transform.ThermModeDeserializer import io.rudolph.netatmo.api.energy.model.transform.ZoneTypeDeserializer import io.rudolph.netatmo.api.energy.model.transform.ZoneTypeSerializer -import io.rudolph.netatmo.api.common.model.DeviceType -import io.rudolph.netatmo.api.common.model.Scale -import io.rudolph.netatmo.api.common.model.ScaleType import io.rudolph.netatmo.api.weather.model.Measure import io.rudolph.netatmo.api.weather.model.transform.MeasureDeserializer import io.rudolph.netatmo.oauth2.model.Scope diff --git a/src/main/java/io/rudolph/netatmo/api/energy/service/EnergyService.kt b/src/main/java/io/rudolph/netatmo/api/energy/service/EnergyService.kt index 201aa1a..7875974 100644 --- a/src/main/java/io/rudolph/netatmo/api/energy/service/EnergyService.kt +++ b/src/main/java/io/rudolph/netatmo/api/energy/service/EnergyService.kt @@ -1,8 +1,7 @@ package io.rudolph.netatmo.api.energy.service -import io.rudolph.netatmo.api.energy.model.* import io.rudolph.netatmo.api.common.model.DeviceType -import io.rudolph.netatmo.api.common.service.CommonService +import io.rudolph.netatmo.api.energy.model.* import retrofit2.Call import retrofit2.http.* diff --git a/src/main/java/io/rudolph/netatmo/api/weather/WeatherConnector.kt b/src/main/java/io/rudolph/netatmo/api/weather/WeatherConnector.kt index 7132247..cb869d1 100644 --- a/src/main/java/io/rudolph/netatmo/api/weather/WeatherConnector.kt +++ b/src/main/java/io/rudolph/netatmo/api/weather/WeatherConnector.kt @@ -7,7 +7,7 @@ import io.rudolph.netatmo.api.weather.service.WeatherService import io.rudolph.netatmo.executable.Executable import retrofit2.Retrofit -class WeatherConnector(api: Retrofit): CommonConnector(api) { +class WeatherConnector(api: Retrofit) : CommonConnector(api) { private val weatherService = api.create(WeatherService::class.java) /** diff --git a/src/main/java/io/rudolph/netatmo/api/weather/model/transform/MeasureDeserializer.kt b/src/main/java/io/rudolph/netatmo/api/weather/model/transform/MeasureDeserializer.kt index e154be3..cdd297e 100644 --- a/src/main/java/io/rudolph/netatmo/api/weather/model/transform/MeasureDeserializer.kt +++ b/src/main/java/io/rudolph/netatmo/api/weather/model/transform/MeasureDeserializer.kt @@ -4,11 +4,11 @@ import com.fasterxml.jackson.core.JsonParser import com.fasterxml.jackson.databind.DeserializationContext import com.fasterxml.jackson.databind.JsonDeserializer import com.fasterxml.jackson.databind.JsonNode +import io.rudolph.netatmo.api.common.transform.JacksonTransform import io.rudolph.netatmo.api.weather.model.BaseOutdoorMeasure import io.rudolph.netatmo.api.weather.model.Measure import io.rudolph.netatmo.api.weather.model.RainGaugeMeasure import io.rudolph.netatmo.api.weather.model.WindMeasure -import io.rudolph.netatmo.api.common.transform.JacksonTransform class MeasureDeserializer : JsonDeserializer() { diff --git a/src/main/java/io/rudolph/netatmo/oauth2/networkinterceptor/AuthInterceptor.kt b/src/main/java/io/rudolph/netatmo/oauth2/networkinterceptor/AuthInterceptor.kt index 89f0297..053af86 100644 --- a/src/main/java/io/rudolph/netatmo/oauth2/networkinterceptor/AuthInterceptor.kt +++ b/src/main/java/io/rudolph/netatmo/oauth2/networkinterceptor/AuthInterceptor.kt @@ -1,11 +1,11 @@ package io.rudolph.netatmo.oauth2.networkinterceptor +import io.rudolph.netatmo.api.common.transform.JacksonTransform import io.rudolph.netatmo.oauth2.TokenStorage import io.rudolph.netatmo.oauth2.errorbuilder import io.rudolph.netatmo.oauth2.logger import io.rudolph.netatmo.oauth2.model.AuthResponse import io.rudolph.netatmo.oauth2.proceed -import io.rudolph.netatmo.api.common.transform.JacksonTransform import okhttp3.FormBody import okhttp3.Interceptor import okhttp3.Request