From 58a21a67a2dfe9f8a01f431f2177d863078aaa42 Mon Sep 17 00:00:00 2001 From: "Jason B. Koh" Date: Thu, 25 Jan 2024 15:28:14 -0800 Subject: [PATCH] implement color temperature and lighting level (#459) * implement color temperature and lighting level * missing import * change naming convention to qudt * only honor correlated color temperature for now * more --- bricksrc/command.py | 14 +++++++++++++- bricksrc/definitions.csv | 4 +++- bricksrc/deprecations.py | 5 +++++ bricksrc/sensor.py | 13 ++++++++++++- bricksrc/substances.py | 5 ++++- 5 files changed, 37 insertions(+), 4 deletions(-) diff --git a/bricksrc/command.py b/bricksrc/command.py index 7b63766f..0ffa8862 100644 --- a/bricksrc/command.py +++ b/bricksrc/command.py @@ -16,10 +16,22 @@ }, }, "Relay_Command": {"tags": [TAG.Point, TAG.Relay, TAG.Command]}, - "Light_Command": {"tags": [TAG.Point, TAG.Light, TAG.Command]}, "Level_Command": { "tags": [TAG.Level, TAG.Command, TAG.Point], }, + "Lighting_Level_Command": { + "tags": [TAG.Point, TAG.Lighting, TAG.Level, TAG.Command] + }, + "Lighting_Correlated_Color_Temperature_Command": { + "tags": [ + TAG.Point, + TAG.Lighting, + TAG.Correlated, + TAG.Color, + TAG.Temperature, + TAG.Command, + ], + }, "Speed_Command": {"tags": [TAG.Point, TAG.Speed, TAG.Command]}, "Cooling_Command": {"tags": [TAG.Point, TAG.Cool, TAG.Command]}, "Heating_Command": {"tags": [TAG.Point, TAG.Heat, TAG.Command]}, diff --git a/bricksrc/definitions.csv b/bricksrc/definitions.csv index 48756a33..ad4ec702 100644 --- a/bricksrc/definitions.csv +++ b/bricksrc/definitions.csv @@ -656,8 +656,10 @@ https://brickschema.org/schema/Brick#Level,, https://brickschema.org/schema/Brick#Level_Command,Adjusts the operational state to a specific level within a predefined range., https://brickschema.org/schema/Brick#Level_Status,The current operational state of a specific level within a predefined range., https://brickschema.org/schema/Brick#Library,"A place for the storage and/or consumption of physical media, e.g. books, periodicals, and DVDs/CDs", -https://brickschema.org/schema/Brick#Light_Command,Controls the amount of the light provided by the device, https://brickschema.org/schema/Brick#Lighting,, +https://brickschema.org/schema/Brick#Lighting_Correlated_Color_Temperature_Command,A command to set correlated color temperature (CCT) which is the temperature of the Planckian radiator whose perceived color most closely resembles that of a given stimulus at the same brightness and under specified viewing conditions.,https://en.wikipedia.org/wiki/Color_temperature#Correlated_color_temperature +https://brickschema.org/schema/Brick#Lighting_Correlated_Color_Temperature_Sensor,A sensor to measure correlated color temperature (CCT) which is the temperature of the Planckian radiator whose perceived color most closely resembles that of a given stimulus at the same brightness and under specified viewing conditions.,https://en.wikipedia.org/wiki/Color_temperature#Correlated_color_temperature +https://brickschema.org/schema/Brick#Lighting_Level_Command,Controls the amount of the light provided by the device typically in percentages., https://brickschema.org/schema/Brick#Lighting_System,"The equipment, devices and interfaces that serve or are a part of the lighting subsystem in a building", https://brickschema.org/schema/Brick#Lighting_Zone,, https://brickschema.org/schema/Brick#Limit,A parameter that places an upper or lower bound on the range of permitted values of another point, diff --git a/bricksrc/deprecations.py b/bricksrc/deprecations.py index 1887ad8a..6fea83d3 100644 --- a/bricksrc/deprecations.py +++ b/bricksrc/deprecations.py @@ -110,6 +110,11 @@ "version": "1.3.0", "mitigation_message": "Exhaust_Fan_Enable_Command is deprecated as a point name should not include more specific equipment names than top level equipment names", "replace_with": BRICK.Enable_Command, + }, + BRICK.Light_Command: { + "version": "1.3.1", + "mitigation_message": "Replaced with Lighting_Command to represent its function more precisely.", + "replace_with": BRICK.Lighting_Level_Command, RDFS.subClassOf: BRICK.Command, }, BRICK.Supply_Water_Temperature_Sensor: { diff --git a/bricksrc/sensor.py b/bricksrc/sensor.py index f0f65d33..ab4b8189 100644 --- a/bricksrc/sensor.py +++ b/bricksrc/sensor.py @@ -1015,6 +1015,18 @@ }, }, }, + "Lighting_Correlated_Color_Temperature_Sensor": { + "tags": [ + TAG.Point, + TAG.Lighting, + TAG.Correlated, + TAG.Color, + TAG.Temperature, + TAG.Sensor, + ], + BRICK.hasQuantity: QUDTQK.CorrelatedColorTemperature, + BRICK.hasSubstance: BRICK.Light, + }, "Luminance_Sensor": { "tags": [TAG.Point, TAG.Sensor, TAG.Luminance], BRICK.hasQuantity: QUDTQK.Luminance, @@ -1485,7 +1497,6 @@ "Refrigerant_Level_Sensor": { BRICK.hasQuantity: BRICK.Level, BRICK.hasSubstance: BRICK.Refrigerant, - "tags": [TAG.Point, TAG.Sensor, TAG.Refrigerant, TAG.Level], }, "Solar_Irradiance_Sensor": { "tags": [TAG.Point, TAG.Sensor, TAG.Irradiance, TAG.Solar], diff --git a/bricksrc/substances.py b/bricksrc/substances.py index 59eaf5ed..567e4062 100644 --- a/bricksrc/substances.py +++ b/bricksrc/substances.py @@ -1,7 +1,10 @@ -from .namespaces import BRICK, OWL, SKOS +from .namespaces import BRICK, OWL, SKOS, TAG # Defining substances substances = { + "Light": { + "tags": [TAG.Light], + }, "Fluid": { SKOS.narrower: { "Refrigerant": {},