@@ -62,10 +62,10 @@ class FHEMWEBConnection(fhemServerSpec: FHEMServerSpec, applicationProperties: A
62
62
get() = serverSpec?.password ? : " "
63
63
64
64
override fun executeCommand (command : String , context : Context ): RequestResult <String > {
65
- LOG .info(" executeTask command " + command)
65
+ LOG .info(" executeTask command $ command" )
66
66
try {
67
67
ProviderInstaller .installIfNeeded(context);
68
- } catch (e: GooglePlayServicesRepairableException ) {
68
+ } catch (e: Exception ) {
69
69
LOG .error(" cannot install play providers" , e)
70
70
}
71
71
@@ -81,7 +81,7 @@ class FHEMWEBConnection(fhemServerSpec: FHEMServerSpec, applicationProperties: A
81
81
reader = InputStreamReader (response.content, Charsets .UTF_8 )
82
82
val content = CharStreams .toString(reader)
83
83
if (content.contains(" <title>" ) || content.contains(" <div id=" )) {
84
- LOG .error(" found strange content: " + content)
84
+ LOG .error(" found strange content: $ content" )
85
85
ErrorHolder .setError(" found strange content in URL $urlSuffix : \r\n\r\n $content " )
86
86
return RequestResult (INVALID_CONTENT )
87
87
}
@@ -116,7 +116,7 @@ class FHEMWEBConnection(fhemServerSpec: FHEMServerSpec, applicationProperties: A
116
116
117
117
val url = serverUrl + if (urlSuffix?.contains(" cmd=" ) == true ) {
118
118
val csrfToken = findCsrfToken(serverUrl) ? : " "
119
- urlSuffix + " &fwcsrf=" + csrfToken
119
+ " $urlSuffix &fwcsrf=$ csrfToken"
120
120
} else urlSuffix
121
121
LOG .info(" accessing URL {}" , url)
122
122
@@ -143,7 +143,7 @@ class FHEMWEBConnection(fhemServerSpec: FHEMServerSpec, applicationProperties: A
143
143
144
144
private fun findCsrfToken (serverUrl : String ): String? {
145
145
try {
146
- val response = doGet(serverUrl + " ?room=notExistingJustToLoadCsrfToken" )
146
+ val response = doGet(" $serverUrl ?room=notExistingJustToLoadCsrfToken" )
147
147
val value = response.headers.getFirstHeaderStringValue(" X-FHEM-csrfToken" )
148
148
response.content.close()
149
149
return value
0 commit comments