Skip to content

Commit

Permalink
1.6.1
Browse files Browse the repository at this point in the history
Added trigger for moonphase value.
  • Loading branch information
RonnyWinkler committed Oct 7, 2024
1 parent 7084972 commit 3d1405e
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 6 deletions.
4 changes: 4 additions & 0 deletions .homeychangelog.json
Original file line number Diff line number Diff line change
Expand Up @@ -278,5 +278,9 @@
"1.6.0": {
"en": "Adjusted flow trigger for Homey FW 12.2.0.",
"de": "Flow-Trigger angepasst für Homey-FW 12.2.0."
},
"1.6.1": {
"en": "Added trigger for moonphase value.",
"de": "Trigger für Mondphasenwert hinzugefügt."
}
}
2 changes: 1 addition & 1 deletion .homeycompose/app.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "nu.baretta.openweathermap",
"version": "1.6.0",
"version": "1.6.1",
"compatibility": ">=8.1.1",
"sdk": 3,
"name": {
Expand Down
2 changes: 1 addition & 1 deletion .homeycompose/capabilities/moonphase.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"de": "Mondphase",
"nl": "Maanfase"
},
"uiComponent": "sensor",
"uiComponent": null,
"getable": true,
"setable": false,
"icon": "/assets/moonphase.svg"
Expand Down
42 changes: 42 additions & 0 deletions .homeycompose/flow/triggers/MoonphaseValueChanged.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"id": "MoonphaseValueChanged",
"title": {
"en": "Moon phase (value) has changed",
"de": "Mondphase (Wert) hat sich geändert",
"nl": "Maanfase (waarde) is veranderd"
},
"hint": {
"en": "Triggers when the moon phase changes.",
"de": "Wird ausgelöst, wenn sich der Mondphase ändert.",
"nl": "Triggert zodra de maanfase veranderd."
},
"tokens": [{
"name": "moonphase",
"type": "number",
"title": {
"en": "Moon phase (0=new moon, 0.25=first quarter, 0.5=full, 0.75=last quarter, 1=new moon)",
"de": "Mondphase (0=Neumond, 0,25=erstes Viertel, 0,5=Vollmond, 0,75=letztes Viertel, 1=Neumond)",
"nl": "Maanfase (0=nieuwe maan, 0,25=eerste kwartier, 0,5=vol, 0,75=laatste kwartier, 1=nieuwe maan)"
},
"example": 0.25
},
{
"name": "location",
"type": "string",
"title": {
"en": "Location",
"de": "Standort",
"nl": "locatie"
},
"example": {
"en": "Amsterdam",
"de": "Berlin"
}
}
],
"args": [{
"name": "device",
"type": "device",
"filter": "driver_id=owmOnecallDaily"
}]
}
52 changes: 49 additions & 3 deletions app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"_comment": "This file is generated. Please edit .homeycompose/app.json instead.",
"id": "nu.baretta.openweathermap",
"version": "1.6.0",
"version": "1.6.1",
"compatibility": ">=8.1.1",
"sdk": 3,
"name": {
Expand Down Expand Up @@ -1009,6 +1009,51 @@
}
]
},
{
"id": "MoonphaseValueChanged",
"title": {
"en": "Moon phase (value) has changed",
"de": "Mondphase (Wert) hat sich geändert",
"nl": "Maanfase (waarde) is veranderd"
},
"hint": {
"en": "Triggers when the moon phase changes.",
"de": "Wird ausgelöst, wenn sich der Mondphase ändert.",
"nl": "Triggert zodra de maanfase veranderd."
},
"tokens": [
{
"name": "moonphase",
"type": "number",
"title": {
"en": "Moon phase (0=new moon, 0.25=first quarter, 0.5=full, 0.75=last quarter, 1=new moon)",
"de": "Mondphase (0=Neumond, 0,25=erstes Viertel, 0,5=Vollmond, 0,75=letztes Viertel, 1=Neumond)",
"nl": "Maanfase (0=nieuwe maan, 0,25=eerste kwartier, 0,5=vol, 0,75=laatste kwartier, 1=nieuwe maan)"
},
"example": 0.25
},
{
"name": "location",
"type": "string",
"title": {
"en": "Location",
"de": "Standort",
"nl": "locatie"
},
"example": {
"en": "Amsterdam",
"de": "Berlin"
}
}
],
"args": [
{
"name": "device",
"type": "device",
"filter": "driver_id=owmOnecallDaily"
}
]
},
{
"id": "MoonriseChanged",
"title": {
Expand Down Expand Up @@ -5245,7 +5290,8 @@
"measure_wind_angle",
"measure_wind_direction_string",
"measure_windstrength_beaufort",
"conditioncode_text"
"conditioncode_text",
"moonphase"
],
"pair": [
{
Expand Down Expand Up @@ -6865,7 +6911,7 @@
"de": "Mondphase",
"nl": "Maanfase"
},
"uiComponent": "sensor",
"uiComponent": null,
"getable": true,
"setable": false,
"icon": "/assets/moonphase.svg"
Expand Down
4 changes: 4 additions & 0 deletions drivers/owmOnecallDaily/device.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,9 @@ class owmOnecallDaily extends Homey.Device {
"trigger": "MoonphaseChanged",
"trigger_token": []
},
"moonphase":{
"trigger": "MoonphaseValueChanged",
},
"measure_ultraviolet":{
"trigger": "UltravioletChanged"
},
Expand Down Expand Up @@ -363,6 +366,7 @@ class owmOnecallDaily extends Homey.Device {
else if ( moonphase > 0.938 && moonphase <= 1 ){
moonphase_type = 'NM';
}
this.getDataCapability('moonphase')['value'] = moonphase;
this.getDataCapability('moonphase_type')['value'] = moonphase_type;
this.getDataCapability('moonphase_type').trigger_token.push({
"trigger_token_id": "moonphase_type",
Expand Down
3 changes: 2 additions & 1 deletion drivers/owmOnecallDaily/driver.compose.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,9 @@
"measure_wind_direction_string",
"measure_windstrength_beaufort",

"conditioncode_text"
"conditioncode_text",

"moonphase"
],
"pair": [{
"id": "settings",
Expand Down

0 comments on commit 3d1405e

Please sign in to comment.