Commit bad22dfc authored by Jiahang Chen's avatar Jiahang Chen
Browse files

add operating hours

parent d4996904
Pipeline #388851 passed with stages
in 1 minute and 4 seconds
......@@ -66,6 +66,7 @@
from import LiquidFillingLevel
from import Location
from import Moisture
from import OperatingHours
from import PersonalName
from import RotationalSpeed
from import Route
......@@ -238,12 +239,9 @@ def build(thing, model):
def build_ditto_features(thing, ditto_features):
for id in ditto_features.keys(): = id
for key in ditto_features[id]["properties"]:
ditto_feature.key = key
ditto_feature.value = ditto_features[id]["properties"][key]
thing.ditto_features[] = ditto_feature
ditto_f = ditto_feature(id=id, key=key, value=ditto_features[id]["properties"][key])
thing.ditto_features[] = ditto_f
def build_role(role):
from import Value
class OperatingHours(Value):
def __init__(self, name="", identifier=""):
self.__total = None
self.__json_out = dict()
def total(self):
return self.__total
def total(self, value):
self.__total = value
def to_json(self):
self.__json_out = super().to_json()
if self.rpm is not None:
self.__json_out["total"] = self.__total
return self.__json_out
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment