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 ml.ml40.features.properties.values.liquid_filling_level import LiquidFillingLevel
from ml.ml40.features.properties.values.location import Location
from ml.ml40.features.properties.values.moisture import Moisture
from ml.ml40.features.properties.values.operating_hours import OperatingHours
from ml.ml40.features.properties.values.personal_name import PersonalName
from ml.ml40.features.properties.values.rotational_speed import RotationalSpeed
from ml.ml40.features.properties.values.route import Route
......@@ -238,12 +239,9 @@ def build(thing, model):
def build_ditto_features(thing, ditto_features):
for id in ditto_features.keys():
ditto_feature.id = 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.id] = ditto_feature
ditto_f = ditto_feature(id=id, key=key, value=ditto_features[id]["properties"][key])
thing.ditto_features[ditto_f.id] = ditto_f
def build_role(role):
......
from ml.ml40.features.properties.values.value import Value
class OperatingHours(Value):
def __init__(self, name="", identifier=""):
super().__init__(
name=name,
identifier=identifier)
self.__total = None
self.__json_out = dict()
@property
def total(self):
return self.__total
@total.setter
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