Created
November 26, 2023 16:25
-
-
Save SebastianStehle/a997326074352f2e0a759a14f26b8a31 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Das Objekt muss nur das abbilden was du auch wirklich brauchst. Du kannst JSON properties ignorieren, wenn du sie nicht brauchst. | |
// DOKU: https://github.com/square/moshi | |
class SensorData { | |
SensorStatus cloud; | |
SensorStatus mqtt; | |
// Der Json property name ist nicht in JAva, deshalb müssen wir hier den Namen überschreiben. | |
@Json(name = "script:10") SensorScript script; | |
} | |
// MQTT und Cloud teilen sich ja die gleiche Struktur | |
class SensorStatus { | |
Boolean connected; | |
} | |
class SensorScript { | |
Int: id; | |
Boolean: running; | |
ArrayList<String> errors; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment