0.4.0 • Published 4 months ago

iobroker.skiinfo v0.4.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

ioBroker.skiinfo

Logo

NPM version Downloads Number of Installations Current version in stable repository

NPM

Tests: Test and Release

skiinfo adapter for ioBroker

With this adapter you can access the current snow depths for mountain, valley and fresh snow, as well as open lifts for various European locations.

Configuration

The adapter dont need any configuration.

vis and widgets

The following widgets actually exists

weitere Informationen

Skiinfo browser

The widget is used to browse through all available countries, regions and areas and set favorite areas. With the table head, you can toggle the sort mode for each column (default, descending, ascending). With the star icon you can toggle the favorite mode. As a datapoint please select the config datapoint.

Skiinfo favorite

The widget is used to show only the favorite ski areas. With the table head, you can toggle the sort mode for each column (default, descending, ascending). With the star icon you can remove the area from the favorite list. As a datapoint please select the config datapoint.

CSS Classes

widgetID and skiinfo

All CSS classes are provided with the two base classes widgetID and skiinfo. This allows you to apply formatting to individual widgets or, when using multiple skiinfo widgets, to all skiinfo widgets.

countries,regions and areas

each of the different information areas can be addressed separately with these 3 CSS classes

Information areas country, region and area

Each of the 3 information areas consists of a normal HTML table.

Selected Elements in Country and Region

Each of the selected elements is located in a span element and has been given the CSS class selected.

Formatting the columns in the Area section

The table header was provided with the CSS classes tharea and thsort. Each column element was provided with txtr for right-aligned and txtl for left-aligned formatting.

Favorite star

The favorite star can be located in a span element and can be addressed via the CSS class favorite. If an element has been selected as a favorite, the span element is supplemented with selected.

Examples for CSS classes

Different color for a selected country or region element
.skiinfo .selected {
    color: green;
}
Different formatting of the regions elements
.skiinfo.regions span {
    color: grey;
}

Available sendTo commands

getServerSkiData

Get the current data for the requested ski data to the client.

Parameters for getServerSkiData

none

Example for getServerSkiData

let instance = 'skiinfo.0';
let response = await sendToAsync(instance, 'getServerSkiData', {});
console.log(response);

getServerCountryData

Loads the country data if it was not already loaded and sends the data back to the client.

Parameters for getServerCountryData

  • countrycode

Example for getServerCountryData

let instance = 'skiinfo.0';
let response = await sendToAsync(instance, 'getServerCountryData', { countrycode: 'deutschland' });
console.log(response);

getServerRegionData

Loads the country and region data if it was not already loaded and sends the data back to the client.

Parameters for getServerRegionData

  • countrycode
  • regioncode

Example for getServerRegionData

let instance = 'skiinfo.0';
let response = await sendToAsync(instance, 'getServerRegionData', {
    countrycode: 'deutschland',
    countrycode: 'bayern',
});
console.log(response);

addServerFavorite

Adds a favorite area for the given country and area. If the favorite area does not exist it will be added. Sends the updated data back to the client.

Parameters for addServerFavorite

  • countrycode
  • regioncode

Example for addServerFavorite

let instance = 'skiinfo.0';
let response = await sendToAsync(instance, 'addServerFavorite', { countrycode: 'deutschland', countrycode: 'bayern' });
console.log(response);

delServerFavorite

Removes a favorite area for the given country and area. Sends the updated data back to the client.

Parameters for delServerFavorite

  • countrycode
  • regioncode

Example for delServerFavorite

let instance = 'skiinfo.0';
let response = await sendToAsync(instance, 'delServerFavorite', { countrycode: 'deutschland', countrycode: 'bayern' });
console.log(response);

Todo

  • to be defined

Changelog

0.4.0 (2025-03-05)

  • fix version info

0.3.0 (2025-03-05)

  • release

0.2.0 (2025-03-05)

  • enable npm deploy

0.1.0 (2025-03-05)

  • initial release
  • The color for favorites has now been made selectable
  • minor CSS improvements
  • Documentation of the sendTo commands has been added.
  • The documentation of the CSS classes has been added.

License

MIT License

Copyright (c) 2025 oweitman oweitman@gmx.de

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0.4.0

4 months ago

0.3.0

4 months ago