Added support for O2, ORP and PH sensors

This commit is contained in:
Michael Zanetti 2021-07-10 01:24:23 +02:00
parent aa411c7dc2
commit 4068aa3ff9
7 changed files with 301 additions and 4 deletions

View File

@ -265,5 +265,7 @@
<file>ui/images/system-suspend.svg</file>
<file>ui/images/zigbee-enddevice.svg</file>
<file>ui/images/zigbee-router.svg</file>
<file>ui/images/sensors/o2.svg</file>
<file>ui/images/sensors/ph.svg</file>
</qresource>
</RCC>

View File

@ -297,6 +297,10 @@ ApplicationWindow {
return Qt.resolvedUrl("images/sensors/windspeed.svg")
case "watersensor":
return Qt.resolvedUrl("images/sensors/water.svg")
case "o2sensor":
return Qt.resolvedUrl("images/sensors/o2.svg")
case "phsensor":
return Qt.resolvedUrl("images/sensors/ph.svg")
case "media":
case "mediacontroller":
case "mediaplayer":

View File

@ -87,7 +87,9 @@ Item {
"irrigation": "lightblue",
"windspeedsensor": "blue",
"ventilation": "lightblue",
"watersensor": "aqua"
"watersensor": "aqua",
"phsensor": "green",
"o2sensor": "lightblue"
}
property var stateColors: {

View File

@ -86,6 +86,9 @@ ThingsListPageBase {
ListElement { interfaceName: "heating"; stateName: "power" }
ListElement { interfaceName: "thermostat"; stateName: "targetTemperature" }
ListElement { interfaceName: "watersensor"; stateName: "waterDetected" }
ListElement { interfaceName: "o2sensor"; stateName: "o2saturation" }
ListElement { interfaceName: "phsensor"; stateName: "ph" }
ListElement { interfaceName: "orpsensor"; stateName: "orp" }
}
delegate: RowLayout {
@ -113,7 +116,7 @@ ThingsListPageBase {
case "closablesensor":
return sensorValueDelegate.stateValue && sensorValueDelegate.stateValue.value === true ? Qt.resolvedUrl("../images/lock-closed.svg") : Qt.resolvedUrl("../images/lock-open.svg");
default:
return app.interfaceToIcon(model.interfaceName)
return app.interfacesToIcon([model.interfaceName, "sensor"])
}
}
}

View File

@ -56,7 +56,7 @@ ThingPageBase {
Repeater {
model: ListModel {
Component.onCompleted: {
var supportedInterfaces = ["temperaturesensor", "humiditysensor", "pressuresensor", "moisturesensor", "lightsensor", "conductivitysensor", "noisesensor", "co2sensor", "presencesensor", "daylightsensor", "closablesensor", "watersensor"]
var supportedInterfaces = ["temperaturesensor", "humiditysensor", "pressuresensor", "moisturesensor", "lightsensor", "conductivitysensor", "noisesensor", "co2sensor", "presencesensor", "daylightsensor", "closablesensor", "watersensor", "phsensor", "o2sensor", "orpsensor"]
for (var i = 0; i < supportedInterfaces.length; i++) {
if (root.thingClass.interfaces.indexOf(supportedInterfaces[i]) >= 0) {
append({name: supportedInterfaces[i]});
@ -89,7 +89,10 @@ ThingPageBase {
"presencesensor": "isPresent",
"daylightsensor": "daylight",
"closablesensor": "closed",
"watersensor": "waterDetected"
"watersensor": "waterDetected",
"phsensor": "ph",
"o2sensor": "o2saturation",
"orpsensor": "orp"
}
}

View File

@ -0,0 +1,199 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="96"
height="96"
id="svg4874"
version="1.1"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)"
viewBox="0 0 96 96.000001"
sodipodi:docname="o2.svg">
<defs
id="defs4876" />
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="5.6199993"
inkscape:cx="27.241991"
inkscape:cy="46.814931"
inkscape:document-units="px"
inkscape:current-layer="g4780"
showgrid="true"
showborder="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-intersection-paths="true"
inkscape:object-nodes="true"
inkscape:snap-smooth-nodes="true"
inkscape:snap-midpoints="true"
inkscape:snap-object-midpoints="true"
inkscape:snap-center="true"
showguides="true"
inkscape:guide-bbox="true"
inkscape:snap-global="true"
inkscape:document-rotation="0"
inkscape:window-width="1464"
inkscape:window-height="933"
inkscape:window-x="72"
inkscape:window-y="27"
inkscape:window-maximized="1">
<inkscape:grid
type="xygrid"
id="grid5451"
empspacing="8" />
<sodipodi:guide
orientation="1,0"
position="8,-8.0000001"
id="guide4063" />
<sodipodi:guide
orientation="1,0"
position="4,-8.0000001"
id="guide4065" />
<sodipodi:guide
orientation="0,1"
position="-8,88.000001"
id="guide4067" />
<sodipodi:guide
orientation="0,1"
position="-8,92.000001"
id="guide4069" />
<sodipodi:guide
orientation="0,1"
position="104,4"
id="guide4071" />
<sodipodi:guide
orientation="0,1"
position="-5,8.0000001"
id="guide4073" />
<sodipodi:guide
orientation="1,0"
position="88,-8.0000001"
id="guide4077" />
<sodipodi:guide
orientation="0,1"
position="-8,84.000001"
id="guide4074" />
<sodipodi:guide
orientation="1,0"
position="12,-8.0000001"
id="guide4076" />
<sodipodi:guide
orientation="1,0"
position="84,-8.0000001"
id="guide4080" />
<sodipodi:guide
position="48,-8.0000001"
orientation="1,0"
id="guide4170" />
<sodipodi:guide
position="-8,48"
orientation="0,1"
id="guide4172" />
<sodipodi:guide
position="92,-8.0000001"
orientation="1,0"
id="guide4760" />
</sodipodi:namedview>
<metadata
id="metadata4879">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(67.857146,-78.50504)">
<g
transform="matrix(0,-1,-1,0,373.50506,516.50504)"
id="g4845"
style="display:inline">
<g
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="next01.png"
transform="matrix(-0.9996045,0,0,1,575.94296,-611.00001)"
id="g4778"
inkscape:label="Layer 1">
<g
transform="matrix(-1,0,0,1,575.99999,611)"
id="g4780"
style="display:inline">
<rect
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:4;marker:none;enable-background:accumulate"
id="rect4782"
width="96.037987"
height="96"
x="-438.00244"
y="345.36221"
transform="scale(-1,1)" />
<ellipse
style="fill:none;stroke:#808080;stroke-width:4.00079;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path871"
cx="-365.36221"
cy="-411.99216"
transform="matrix(0,-1,-1,0,0,0)"
rx="14"
ry="14.00554" />
<ellipse
style="fill:none;stroke:#808080;stroke-width:4.00079;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path875"
cx="-407.36221"
cy="-363.97318"
transform="matrix(0,-1,-1,0,0,0)"
rx="12"
ry="12.004748" />
<ellipse
style="fill:none;stroke:#808080;stroke-width:4.00079;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path877"
cx="-393.36221"
cy="-419.99533"
transform="matrix(0,-1,-1,0,0,0)"
rx="8"
ry="8.0031652" />
<ellipse
style="fill:none;stroke:#808080;stroke-width:4.00079;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path881"
cx="-373.36221"
cy="-375.97791"
transform="matrix(0,-1,-1,0,0,0)"
rx="12"
ry="12.004748" />
<ellipse
style="fill:none;stroke:#808080;stroke-width:4.00079;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="path885"
cx="-417.62314"
cy="-396.24686"
transform="matrix(0,-1,-1,0,0,0)"
rx="13.739084"
ry="13.744521" />
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
viewBox="0 0 96 96.000001"
version="1.1"
id="svg4874"
height="96"
width="96"
sodipodi:docname="ph.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1464"
inkscape:window-height="933"
id="namedview29"
showgrid="true"
inkscape:zoom="7.2916667"
inkscape:cx="48"
inkscape:cy="48"
inkscape:window-x="72"
inkscape:window-y="27"
inkscape:window-maximized="1"
inkscape:current-layer="svg4874"
inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid854" />
</sodipodi:namedview>
<defs
id="defs4876" />
<metadata
id="metadata4879">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<path
d="m 51.41408,53.73909 c -0.862857,0.873888 -2.057979,1.419555 -3.382974,1.42862 l -0.0018,7.1e-5 c -2.649911,0.01805 -4.811802,-2.114796 -4.828491,-4.763721 -0.01511,-2.401076 3.02705,-27.146345 4.588738,-30.548106 8.9e-4,-6e-6 0.0018,-7.1e-5 0.0026,-9.19e-4 0.0011,-7.83e-4 0.0027,-0.0027 0.0035,-0.0036 0.0012,-0.0015 0.0016,-0.002 0.0027,-0.0027 9.13e-4,-9.26e-4 0.0026,-0.0018 0.0035,-0.0018 1.653697,3.34979 4.982191,28.090365 4.997289,30.491397 0.0084,1.32452 -0.522113,2.526668 -1.384952,3.400582 z"
id="path4197"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;enable-background:accumulate" />
<rect
transform="rotate(90)"
y="-95.999985"
x="8.5593265e-06"
height="96"
width="96"
id="rect4782"
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:none;stroke-width:3.99921;marker:none;enable-background:accumulate" />
<circle
cy="48"
cx="47.999989"
id="path833"
style="fill:none;fill-opacity:1;stroke:#808080;stroke-width:4;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
r="40" />
<path
id="path947"
style="opacity:1;fill:none;stroke:#808080;stroke-width:8;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 16.498171,48 c 0,-2.174747 0.220373,-4.298024 0.640005,-6.348717 0.419633,-2.050693 1.038525,-4.028803 1.835565,-5.913216 0.79704,-1.884414 1.772226,-3.675131 2.904448,-5.351039 1.132221,-1.675908 2.421477,-3.237007 3.846654,-4.662185 1.425178,-1.425177 2.986277,-2.714433 4.662185,-3.846654 1.675908,-1.132222 3.466625,-2.107408 5.351039,-2.904448 1.884413,-0.79704 3.862523,-1.415932 5.913216,-1.835565"
sodipodi:nodetypes="cssssssc" />
<path
id="path950"
style="opacity:1;fill:none;stroke:#808080;stroke-width:8;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 54.348717,17.138176 c 2.050693,0.419633 4.028803,1.038525 5.913216,1.835565 1.884414,0.79704 3.675131,1.772226 5.351039,2.904448 1.675908,1.132221 3.237007,2.421477 4.662185,3.846654 1.425177,1.425178 2.714433,2.986277 3.846654,4.662185 1.132222,1.675908 2.107408,3.466625 2.904448,5.351039 0.79704,1.884413 1.415932,3.862523 1.835565,5.913216 0.419632,2.050693 0.640005,4.17397 0.640005,6.348717"
sodipodi:nodetypes="cssssssc" />
</svg>

After

Width:  |  Height:  |  Size: 4.0 KiB