소스 검색

Allow to use actor, sensor and kettle dropdown for actor and sensor

config.
tags/3.1_alpha
Manuel83 8 년 전
부모
커밋
47268d8d1c
3개의 변경된 파일28개의 추가작업 그리고 1개의 파일을 삭제
  1. +9
    -0
      modules/core/core.py
  2. +18
    -0
      modules/core/props.py
  3. +1
    -1
      modules/ui/static/bundle.js

+ 9
- 0
modules/core/core.py 파일 보기

@@ -283,6 +283,15 @@ class CraftBeerPi(ActorAPI, SensorAPI):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append(
{"name": m, "label": t.label, "type": "select", "configurable": True, "options": t.options})
elif isinstance(tmpObj.__getattribute__(m), Property.Actor):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append({"name": m, "label": t.label, "type": "actor", "configurable": t.configurable})
elif isinstance(tmpObj.__getattribute__(m), Property.Sensor):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append({"name": m, "label": t.label, "type": "sensor", "configurable": t.configurable})
elif isinstance(tmpObj.__getattribute__(m), Property.Kettle):
t = tmpObj.__getattribute__(m)
self.cache[key][name]["properties"].append({"name": m, "label": t.label, "type": "kettle", "configurable": t.configurable})

for name, method in cls.__dict__.iteritems():
if hasattr(method, "action"):


+ 18
- 0
modules/core/props.py 파일 보기

@@ -21,6 +21,24 @@ class Property(object):
self.label = label
self.configurable = configurable

class Actor(PropertyType):
def __init__(self, label):
PropertyType.__init__(self)
self.label = label
self.configurable = True
class Sensor(PropertyType):
def __init__(self, label):
PropertyType.__init__(self)
self.label = label
self.configurable = True

class Kettle(PropertyType):
def __init__(self, label):
PropertyType.__init__(self)
self.label = label
self.configurable = True


class StepProperty(Property):
class Actor(PropertyType):
def __init__(self, label):


+ 1
- 1
modules/ui/static/bundle.js
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


불러오는 중...
취소
저장