Skip to content

Commit

Permalink
Restored some legacy Meta Definitions temporarily
Browse files Browse the repository at this point in the history
- Added missing legacy groups to existing Meta Definitions
- Restored some legacy Meta Definitions
- Bumped version
  • Loading branch information
ramonPaulAlvarez authored Mar 10, 2021
1 parent 61b8472 commit ae5bc76
Show file tree
Hide file tree
Showing 5 changed files with 278 additions and 5 deletions.
5 changes: 4 additions & 1 deletion meta_definitions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
from meta_definitions.device import live_calculated_metrics as device_live_calculated_metas
from meta_definitions.device import metrics as device_metrics
from meta_definitions.device import temporary_metrics as device_temporary_metas
from meta_definitions.device.definitions import ALL as DEVICE_DEFINITIONS
from meta_definitions.device.definitions import ALL as CURRENT_DEVICE_DEFINITIONS
from meta_definitions.device.temporary_definitions import ALL as TEMPORARY_DEVICE_DEFINITIONS

__all__ = [
"AREA_METAS",
Expand Down Expand Up @@ -35,3 +36,5 @@ def get_all_metrics_from_file(metrics_file):
DEVICE_METRICS_COMPLEX = get_all_metrics_from_file(complex_device_metrics)

DEVICE_METRICS_LIVE_CALCULATED = get_all_metrics_from_file(device_live_calculated_metas)

DEVICE_DEFINITIONS = {**CURRENT_DEVICE_DEFINITIONS, **TEMPORARY_DEVICE_DEFINITIONS}
6 changes: 3 additions & 3 deletions meta_definitions/device/definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1441,7 +1441,7 @@
"display_name": "Flow Setpoint",
"json_schema": {"type": "number"},
"unit_of_measure": "°C",
"groups": ["~rule_trigger"],
"groups": ["~rule_trigger", "ctrl_flow_temperature"],
},
META_FLOW_TEMPERATURE: {
"display_name": "Flow Temperature",
Expand Down Expand Up @@ -2864,7 +2864,7 @@
"json_schema": {"type": "number"},
"unit_of_measure": "°C",
"decimal_precision": 2,
"groups": ["~rule_trigger"],
"groups": ["~rule_trigger", "ctrl_return_temperature"],
},
META_REVERSE_POWER_STATUS: {
"display_name": "Reverse Power Status",
Expand Down Expand Up @@ -3320,7 +3320,7 @@
"json_schema": {"type": "number", "minimum": 0, "maximum": 100},
"unit_of_measure": "%",
"decimal_precision": 0,
"groups": ["~rule_trigger"],
"groups": ["~rule_trigger", "ctrl_supply_fan_speed"],
},
META_SURFACE_TEMPERATURE: {
"display_name": "Surface Temperature",
Expand Down
241 changes: 241 additions & 0 deletions meta_definitions/device/temporary_definitions.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# -*- coding: utf-8 -*-
from .temporary_metrics import *

# Legacy Device Meta Definitions
ALL = {
META_AIR_BAROMETRIC_PRESSURE: {
"groups": ["~environment"],
"json_schema": {"type": "number"},
"unit_of_measure": "Pa",
"value": 0,
},
META_AIR_CO2: {
"groups": ["~environment"],
"json_schema": {"type": "number"},
"unit_of_measure": "ppm",
"value": 0,
},
META_AIR_VOC: {"groups": ["~environment"], "json_schema": {"type": "number"}, "value": 0},
META_AMBIENT_NOISE: {
"groups": ["~environment"],
"json_schema": {"type": "number"},
"unit_of_measure": "dB",
"value": 0,
},
META_AMBIENT_TEMPERATURE: {
"groups": ["~environment", "~rule_trigger"],
"json_schema": {"type": "number"},
"unit_of_measure": "C",
"value": 0,
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
META_CO2_SETPOINT: {
"value": 0,
"display_name": "CO2 Setpoint",
"unit_of_measure": "ppm",
"json_schema": {"type": "number"},
"groups": ["ctrl_co2"],
},
META_COOLING_VALVE: {
"value": 0,
"display_name": "Cooling Valve",
"groups": ["~environment"],
"unit_of_measure": "%",
"json_schema": {"type": "number"},
},
META_ENABLE: {
"value": "",
"display_name": "Enable",
"json_schema": {"type": "boolean"},
"value_display_name": {"type": "enum", "true": "Enable", "false": "Disable"},
"groups": ["ctrl_enable"],
},
META_EXTRACT_FAN_PRESSURE_SETPOINT: {
"value": 0,
"display_name": "Extract Fan Pressure Setpoint",
"unit_of_measure": "Pa",
"json_schema": {"type": "number"},
"groups": ["ctrl_extract_pressure"],
},
META_EXTRACTFAN_SPEED_SETPOINT: {
"value": 0,
"display_name": "Extract Fan Speed Setpoint",
"unit_of_measure": "%",
"groups": ["ctrl_extract_fan_speed"],
"json_schema": {"type": "number", "minimum": 0, "maximum": 100},
"value_display_name": {
"type": "range",
"range:0": "Off",
"range:1-33": "Low",
"range:34-66": "Medium",
"range:67-100": "High",
},
},
META_EXTRACT_TEMPERATURE_SETPOINT: {
"value": 0,
"display_name": "Extract Temperature Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"groups": ["ctrl_extract_temperature"],
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
META_FAN_MODE: {
"value": "",
"display_name": "Fan Mode",
"json_schema": {"type": "string", "enum": ["", "Low", "Medium", "High"]},
"groups": ["ctrl_fan_mode"],
},
META_FLOW_PRESSURE_SETPOINT: {
"value": 0,
"display_name": "Pressure Setpoint",
"unit_of_measure": "Pa",
"json_schema": {"type": "number"},
"groups": ["ctrl_flow_pressure"],
},
META_FLOW_TEMPERATURE_SET_POINT: {
"value": 0,
"display_name": "Flow Temperature Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"groups": ["ctrl_flow_temperature"],
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
META_HEAT_PUMP_MODE: {
"value": "",
"display_name": "Mode",
"json_schema": {"type": "string", "enum": ["", "Heating", "Cooling"]},
"groups": ["ctrl_mode"],
},
META_HEATING_VALVE: {
"value": 0,
"display_name": "Heating Valve",
"groups": ["~environment"],
"unit_of_measure": "%",
"json_schema": {"type": "number"},
},
META_HUMIDITY_SETPOINT: {
"value": 0,
"display_name": "Humidity Setpoint",
"unit_of_measure": "%RH",
"json_schema": {"type": "number"},
"groups": ["ctrl_humidity"],
},
META_LOUVERS: {
"display_name": "Louvers",
"groups": ["ctrl_louvers"],
"json_schema": {"type": "boolean"},
"value": "",
"value_display_name": {"type": "enum", "true": "Swing", "false": "Fixed"},
},
META_MODE: {
"value": "",
"display_name": "Mode",
"json_schema": {"type": "string", "enum": ["", "Heat", "Cool", "Air", "Auto"]},
"groups": ["ctrl_mode"],
},
META_RETURN_SETPOINT: {
"value": 0,
"display_name": "Return Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"groups": ["ctrl_return_temperature"],
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
META_SPEED_SETPOINT: {
"value": 0,
"display_name": "Speed Setpoint",
"unit_of_measure": "%",
"groups": ["ctrl_speed"],
"json_schema": {"type": "number", "minimum": 0, "maximum": 100},
"value_display_name": {
"type": "range",
"range:0": "Off",
"range:1-33": "Low",
"range:34-66": "Medium",
"range:67-100": "High",
},
},
META_SUPPLY_FAN_PRESSURE_SETPOINT: {
"value": 0,
"display_name": "Supply Fan Pressure Setpoint",
"unit_of_measure": "Pa",
"json_schema": {"type": "number"},
"groups": ["ctrl_supply_pressure"],
},
META_SUPPLY_TEMPERATURE_SETPOINT: {
"value": 0,
"display_name": "Supply Temperature Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
"groups": ["ctrl_supply_temperature"],
},
META_X1_SETPOINT: {
"value": 0,
"display_name": "X1 Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"groups": ["ctrl_x1"],
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
META_X2_SETPOINT: {
"value": 0,
"display_name": "X2 Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"groups": ["ctrl_x2"],
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
META_Y1_SETPOINT: {
"value": 0,
"display_name": "Y1 Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"groups": ["ctrl_y1"],
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
META_Y2_SETPOINT: {
"value": 0,
"display_name": "Y2 Setpoint",
"unit_of_measure": "C",
"json_schema": {"type": "number"},
"groups": ["ctrl_y2"],
"value_display_name": {
"type": "range",
"range:-100-0": "Freezing",
"range:100-1000": "Boiling",
},
},
}
29 changes: 29 additions & 0 deletions meta_definitions/device/temporary_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,32 @@
"supplytemperature_setpoint", # to be renamed to supply_air_temperature_setpoint
"volumetric_flow", # to be renamed to supply_air_volume
)

# Legacy Device Meta Names
META_AIR_BAROMETRIC_PRESSURE = "air_barometric_pressure"
META_AIR_CO2 = "air_co2"
META_AIR_VOC = "air_voc"
META_AMBIENT_NOISE = "ambient_noise"
META_AMBIENT_TEMPERATURE = "ambient_temperature"
META_CO2_SETPOINT = "co2_setpoint"
META_COOLING_VALVE = "cooling_valve"
META_ENABLE = "enable"
META_EXTRACT_FAN_PRESSURE_SETPOINT = "extractfan_pressure_setpoint"
META_EXTRACTFAN_SPEED_SETPOINT = "extractfan_speed_setpoint"
META_EXTRACT_TEMPERATURE_SETPOINT = "extracttemperature_setpoint"
META_FAN_MODE = "fan_mode"
META_FLOW_PRESSURE_SETPOINT = "flowpressure_setpoint"
META_FLOW_TEMPERATURE_SET_POINT = "flowtemp_setpoint"
META_HEAT_PUMP_MODE = "heatpump_mode"
META_HEATING_VALVE = "heating_valve"
META_HUMIDITY_SETPOINT = "humidity_setpoint"
META_LOUVERS = "louvers"
META_MODE = "mode"
META_RETURN_SETPOINT = "return_setpoint"
META_SPEED_SETPOINT = "speed_setpoint"
META_SUPPLY_FAN_PRESSURE_SETPOINT = "supplyfan_pressure_setpoint"
META_SUPPLY_TEMPERATURE_SETPOINT = "supplytemperature_setpoint"
META_X1_SETPOINT = "x1_setpoint"
META_X2_SETPOINT = "x2_setpoint"
META_Y1_SETPOINT = "y1_setpoint"
META_Y2_SETPOINT = "y2_setpoint"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def requirements():

setuptools.setup(
name="meta-definitions",
version="1.0.10",
version="1.0.11",
author="Gooee",
description="Meta Definitions used in the Gooee Cloud",
install_requires=requirements(),
Expand Down

0 comments on commit ae5bc76

Please sign in to comment.