-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
getPlainValue without quotes #38
Comments
Please show exact examples. |
Hi Apollon77, Output example with quotes:
Output example without quotes:
|
The simple-api adapter provides api ways and so the value is returned based on its data type!! 44 Is a number and the other one is a string. So response is as expected. |
Ok then it was an understanding mistake with the data types and the processing by the simple-api adapter on my part. But is there no hope for me that maybe an additional function could be implemented to output strings without quotes via HTTP Get request? :) |
I have the same problem - I created a large HTML formated table in an object and tried to use getPlainText. Due to the quotes the page is not shown correct. So I would also appreciate an extension. |
But why you not use "JSON.parse" with the response and then handle it as you need it in your client side code? |
There is no client side code :) - my idea is/was to create a html page with the javascript adapter store it in an object and use getPlainText to show the page in a browser. This doesn‘t work because of the added quotes. In my case: I found a different solution today :) |
Same issue here with get/getBulk/getPlainValue. If value is 0 then i got it with qoutes, otherwise only the value as number. Data comes from tuya adapter. |
If it comes as „0“ then the value in fact is a string - and then also the object in the tuya Adapter should be a string value. So this is „to be expected“ as well. String is not a number. |
Hallo, ich habe mir jetzt einen Bilderrahmen als Display geholt, welches sich Werte stumpf über eine URL holen kann. Dargestellt werden soll eine Temperatur. Blöd, dass bei runden Zahlen die Kommastelle fehlt und statt einem Dezimalkomma ein Dezimalpunkt genommen wird. Auch kann ich kein Grad-Zeichen hintendran hängen. Das geht alles, wenn ich den Wert als String ausgebe. Aber dann sind da Anführungszeichen vor und hinter dem Wert. Diese sollten optional abgeschaltet werden können. |
Ich glaube Ihr versteht den Adapter falsch ... Das ist eine API und kein "Fertig für eine Visualisierungs-Anzeige Frontend Datenlieferand". Ihr kommt um irgendeine Logik die Daten aufbereitet nicht drum herum - oder man muss hier einiges erweitern. Nachkommastellen bei einer ".0" Zahl denke bekommst Du auch mit String nicht |
Hi,
When you query the browser with getPlainValue/stateID some results are displayed in quotes, it does not depend on the datatype, I can only assume that if a stateID contains a space these results are displayed in quotes.
My suggestion would be to display generally without quotes if possible, or to provide an additional HTTP Get request that displays the output without quotes.
The background for the request is that I fill a datapoint with HTML data using a script to display it on my magic mirror using an iframe, this works great but the output is spoiled by the quotes.
Greetings
TeNNo2k5
The text was updated successfully, but these errors were encountered: