diff --git a/backend/lib/Definition/EntityDefinition.json b/backend/lib/Definition/EntityDefinition.json index 91894e1..a0cbf2c 100644 --- a/backend/lib/Definition/EntityDefinition.json +++ b/backend/lib/Definition/EntityDefinition.json @@ -31,14 +31,16 @@ "required" : ["title"], "optional" : ["description", "details:", "owner:", "tolerance"], "interpreter" : "AggregatorInterpreter", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Gruppe" }, { "name" : "user", "required" : ["title"], "optional" : ["description", "details:", "owner:", "tolerance"], "interpreter" : "AggregatorInterpreter", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Nutzer" }, { "name" : "power", @@ -46,7 +48,8 @@ "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "MeterInterpreter", "unit" : "kW/h", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Strom" }, { "name" : "gas", @@ -54,7 +57,8 @@ "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "MeterInterpreter", "unit" : "m³/h", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Gas" }, { "name" : "water", @@ -62,7 +66,8 @@ "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "MeterInterpreter", "unit" : "m³/h", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Wasser" }, { "name" : "temperature", @@ -70,7 +75,8 @@ "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "SensorInterpreter", "unit" : "°C", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Temperatur" }, { "name" : "pressure", @@ -78,7 +84,8 @@ "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "SensorInterpreter", "unit" : "hPa", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Luftdruck" }, { "name" : "humidity", @@ -86,7 +93,8 @@ "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "SensorInterpreter", "unit" : "%", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Luftfeuchtigkeit" }, { "name" : "windspeed", @@ -94,20 +102,23 @@ "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "SensorInterpreter", "unit" : "km/h", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Windgeschwindigkeit" }, { "name" : "radition", "required" : ["title"], "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "SensorInterpreter", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Strahlung" }, { "name" : "luminosity", "required" : ["title"], "optional" : ["description", "details:", "owner:", "address:", "tolerance"], "interpreter" : "SensorInterpreter", - "icon" : "" // TODO look for an icon + "icon" : "", // TODO look for an icon + "de_name" : "Lichtstärke" } ] diff --git a/backend/lib/Definition/PropertyDefinition.json b/backend/lib/Definition/PropertyDefinition.json index 51e9fb2..bd5fc4e 100644 --- a/backend/lib/Definition/PropertyDefinition.json +++ b/backend/lib/Definition/PropertyDefinition.json @@ -31,54 +31,64 @@ "type" : "string", "pattern" : "/[a-z0-9 ]/", "min": 3, - "max" : 255 + "max" : 255, + "de_name" : "Titel" }, { "name" : "description", - "type" : "string", + "type" : "text", "pattern" : "/[a-z0-9 ]/", // TODO add whitespaces as \t \n \r - "max" : 255 // TODO allowed column size in database? + "max" : 255, // TODO allowed column size in database? + "de_name" : "Beschreibung" }, { "name" : "cost", "type" : "float", - "min" : 0 + "min" : 0, + "de_name" : "Kosten" }, { "name" : "resolution", "type" : "integer", - "min" : 1 + "min" : 1, + "de_name" : "Auflösung" }, { "name" : "tolerance", "type" : "float", "min" : 0, - "max" : 1 + "max" : 1, + "de_name" : "Toleranz" }, { "name" : "address:lat", "type" : "float", "min" : -90, - "max" : 90 + "max" : 90, + "de_name" : "Latitude" }, { "name" : "address:lon", "type" : "float", "min" : -90, - "max" : 90 + "max" : 90, + "de_name" : "Longitude" }, { "name" : "address:city", "type" : "string", - "pattern" : "" // TODO add pattern + "pattern" : "", // TODO add pattern + "de_name" : "Stadt" }, { "name" : "address:houseno", - "type" : "string" + "type" : "string", + "de_name" : "Hausnummer" }, { "name" : "address:postal", - "type" : "string" + "type" : "string", + "de_name" : "Postleitzahl" }, { "name" : "address:state", @@ -273,29 +283,35 @@ "Wallis and Futuna Islands", "Yemen", "Zambia" - ] + ], + "de_name" : "Land" }, { "name" : "address:country", - "type" : "string" + "type" : "string", + "de_name" : "Staat" }, { "name" : "photo:url", "type" : "string", - "pattern" : "" // TODO add pattern + "pattern" : "", // TODO add pattern + "de_name" : "Foto (URL)" }, { "name" : "cuuid", "type" : "string", - "max" : 37 + "max" : 37, + "de_name" : "Cotroller UUID" }, { "name" : "port", "type" : "string", - "max" : 6 + "max" : 6, + "de_name" : "Controller Pin" }, { "name" : "active", - "type" : "boolean" + "type" : "boolean", + "de_name" : "Aktiv?" } ] diff --git a/backend/lib/Definition/PropertyDefinition.php b/backend/lib/Definition/PropertyDefinition.php index 427f5b4..a9ffd60 100644 --- a/backend/lib/Definition/PropertyDefinition.php +++ b/backend/lib/Definition/PropertyDefinition.php @@ -36,7 +36,7 @@ class PropertyDefinition extends Definition { const FILE = '/lib/Definition/PropertyDefinition.json'; /** - * One of: string, integer, float, boolean, multiple + * One of: string, integer, float, boolean, multiple, text * * @var string */ @@ -84,6 +84,7 @@ class PropertyDefinition extends Definition { public function validateValue($value) { switch ($this->type) { case 'string': + case 'text': $invalid = !is_string($value); $invalid |= isset($this->pattern) && !preg_match($this->pattern, $value); $invalid |= isset($this->min) && strlen($value) < $this->min; diff --git a/controller/README b/controller/README new file mode 100644 index 0000000..3e13b28 --- /dev/null +++ b/controller/README @@ -0,0 +1 @@ +Dieses Verzeichnis enthällt den Sourcecode für die Messcontroller und deren Webfrontend. \ No newline at end of file diff --git a/controller/index.html b/controller/index.html new file mode 100644 index 0000000..2cc8346 --- /dev/null +++ b/controller/index.html @@ -0,0 +1,42 @@ + + +
+ +Hier können Sie ihren Stromzähler einrichten.
+ +Derzeit sind folgende Zähler/Sensoren konfiguriert:
+# | UUID | Typ | Port | Value |
---|
Hier können sie einen neuen Kanal hinzufügen:
+ + + + + + +