Skip to content

Commit

Permalink
var
Browse files Browse the repository at this point in the history
  • Loading branch information
jack-blackson committed Jan 29, 2024
1 parent 1da6e84 commit 0b26483
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 4 deletions.
25 changes: 25 additions & 0 deletions admin/index_m.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@

}).trigger('change');
onChange(false);
$('#loadSetup').click(loadSetup);

console.log('Settings loaded')

}
Expand Down Expand Up @@ -250,6 +252,12 @@
return arr; // returns array
}

function loadSetup() {
//var newValue = JSON.stringify(getSettings());
console.log('Testfunction')
}


// This will be called by the admin adapter when the user presses the save button
function save(callback) {
// example: select elements with class=value and build settings object
Expand Down Expand Up @@ -371,6 +379,23 @@ <h6 class="title translate" data-lang="regionsetup">regionsetup</h6>
<div class="row">

</div>

<div class="row">
<div class="input-field col s3">
<input type="text" id="lat" class="value" />
<label for="lat" class="translate">Lattitude</label>
</div>
<div class="input-field col s3">
<input type="text" id="long" class="value" />
<label for="long" class="translate">Longitude</label>
</div>
<div class="row">
<div class="col s4">
<a id="loadSetup" class="waves-effect waves-light btn"><i class="material-icons left">notifications_active</i><span class="translate">loadSetup</span></a>
</div>
</div>

</div>

<div class="col s12">
<h6 class="title translate" data-lang="layout">layout</h6>
Expand Down
15 changes: 14 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,21 @@
{
"common": {
"name": "meteoalarm",
"version": "2.3.8",
"version": "3.0.0",
"news": {
"3.0.0": {
"en": "Breaking change: Switch to polygon data",
"de": "Große Änderung: Umschalten auf Polygondaten",
"ru": "Перерыв: Переключение на данные полигона",
"pt": "Mudança de ruptura: Mudar para dados de polígono",
"nl": "Verandering: Omschakelen naar veelhoekgegevens",
"fr": "Briser le changement : Passer aux données polygonales",
"it": "Cambiamento di rottura: Passare ai dati del poligono",
"es": "Cambio de ruptura: Cambiar a datos de polígono",
"pl": "Łamanie zmian: Przełącz na dane wielokąta",
"uk": "Зміна розривів: Перемикач даних полігонів",
"zh-cn": "中断更改 : 切换到多边形数据"
},
"2.3.8": {
"en": "Bugfix alarm reference",
"de": "Bugfix Alarm Referenz",
Expand Down
9 changes: 8 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const utils = require('@iobroker/adapter-core');
//const request = require('request');
const moment = require('moment');
const util = require('util')
const turf = require('@turf/boolean-point-in-polygon')
var parseString = require('xml2js').parseString;
var parseStringPromise = require('xml2js').parseStringPromise;
const stateAttr = require('./lib/stateAttr.js'); // State attribute definitions
Expand All @@ -32,6 +33,8 @@ var DescFilter2 = '';
var country = '';
var countryConfig = '';
var regionConfig = '';
var latConfig = '';
var longConfig = '';
var countEntries = 0;
var typeArray = [];
var urlArray = [];
Expand Down Expand Up @@ -237,7 +240,11 @@ async function getData(){
regionName = adapter.config.regionName
imageSizeSetup = Number(adapter.config.imageSize)
alarmAll = []


latConfig = adapter.config.lat
longConfig = adapter.config.long

//adapter.log.debug('Longitute : ' + longConfig)

if (regionConfig == "0"|| !regionConfig){
adapter.log.error('Please select a valid region in setup!')
Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "iobroker.meteoalarm",
"version": "2.3.8",
"version": "3.0.0",
"description": "Meteolaram",
"main": "main.js",
"repository": {
Expand Down Expand Up @@ -29,7 +29,8 @@
"bent": "^7.3.12",
"csv-parse": "4.16.3",
"moment": "2.30.1",
"xml2js": "^0.5.0"
"xml2js": "^0.5.0",
"@turf/boolean-point-in-polygon": "^6.5.0"
},
"scripts": {
"test": "npm run test:package && npm run test:unit",
Expand Down

0 comments on commit 0b26483

Please sign in to comment.