Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MeisterTR committed Apr 30, 2019
1 parent 0f695fb commit ffff159
Show file tree
Hide file tree
Showing 29 changed files with 6,896 additions and 1,169 deletions.
31 changes: 24 additions & 7 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
gulpfile.js
admin/i18n
tasks
node_modules
.idea
.git
/node_modules
test
.idea
node_modules/
nbproject/
.vs*/
Thumbs.db
gulpfile.js

test/
travis/
.travis.yml
appveyor.yml
.travis.yaml
appveyor.yaml

tslint.json
.eslintrc.json

# npm package files
iobroker.*.tgz
package-lock.json

# i18n intermediate files
admin/i18n

# maintenance scripts
maintenance/**
25 changes: 17 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,32 @@
os:
- linux
- osx
- windows

language: node_js
node_js:
- '4'
- '6'
- '8'
- '10'
before_script:
- export NPMVERSION=$(echo "$($(which npm) -v)"|cut -c1)
- 'if [[ $NPMVERSION == 5 ]]; then npm install -g npm@5; fi'
- npm -v
- npm install [email protected]
- 'npm install https://github.com/ioBroker/ioBroker.js-controller/tarball/master --production'

env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-4.8
- g++-4.9

before_install:
- 'if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then CC=gcc-4.9; fi'
- 'if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then CC=g++-4.9; fi'
before_script:
- export NPMVERSION=$(echo "$($(which npm) -v)"|cut -c1)
- 'if [[ $NPMVERSION == 5 ]]; then npm install -g npm; fi'
- npm -v
- npm install [email protected]
- 'npm install https://github.com/ioBroker/ioBroker.js-controller/tarball/master --production'
script:
- npm run test:package
- npm run test:iobroker
12 changes: 6 additions & 6 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)
MIT License

Copyright (c) 2018 @@Author@@ <@@email@@>
Copyright (c) 2019 MeisterTR

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -9,13 +9,13 @@ 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 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.
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
52 changes: 33 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,37 +1,51 @@

<img src="admin/landroid.png" alt="drawing" width="50"/> ioBroker.worx
=============
<h1>
<img src="admin/worx.png" width="64"/>
ioBroker.worx
</h1>

[![NPM version](http://img.shields.io/npm/v/iobroker.worx.svg)](https://www.npmjs.com/package/iobroker.worx)
[![Downloads](https://img.shields.io/npm/dm/iobroker.worx.svg)](https://www.npmjs.com/package/iobroker.worx)
[![Travis-CI](https://api.travis-ci.org/MeisterTR/ioBroker.worx?branch=master)](https://travis-ci.org/MeisterTR/ioBroker.worx)
[![AppVeyor](https://ci.appveyor.com/api/projects/status/github/MeisterTR/ioBroker.worx?branch=master&svg=true)](https://ci.appveyor.com/project/MeisterTR/ioBroker-worx/)
[![License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](https://github.com/MeisterTR/ioBroker-worx/blob/master/LICENSE)
[![Dependency Status](https://img.shields.io/david/MeisterTR/iobroker.worx.svg)](https://david-dm.org/MeisterTR/iobroker.worx)
[![Known Vulnerabilities](https://snyk.io/test/github/MeisterTR/ioBroker.worx/badge.svg)](https://snyk.io/test/github/MeisterTR/ioBroker.worx)

[![NPM](https://nodei.co/npm/iobroker.worx.png?downloads=true)](https://nodei.co/npm/iobroker.worx/)

NOT FINISHED YET!!!!!!!!!!!!!!!!!!!!!! DO NOT INSTALL
=============

**Tests:** Linux/Mac: [![Travis-CI](http://img.shields.io/travis/MeisterTR/ioBroker.worx/master.svg)](https://travis-ci.org/MeisterTR/ioBroker.worx)
Windows: [![AppVeyor](https://ci.appveyor.com/api/projects/status/github/MeisterTR/ioBroker.worx?branch=master&svg=true)](https://ci.appveyor.com/project/MeisterTR/ioBroker-worx/)
[Deutsche Beschreibung hier](README_de.md)
## worx adapter for ioBroker

control via cloud and mqtt

## Description
This adapter connects IoBroker with your Landroid S/M/L
Temperatures, mowing times, battery level and various other data are read out from the mower
The adapter can control the mower and you can change config params like mowtimes.

<img src="admin/worx_ada2.png" alt="drawing" width="100%"/>
## Changelog

## installation
At least Node 4.X.X must be installed, Node 0.10 and 0.12 are no longer supported by this adapter.
### 0.0.1
* (MeisterTR) initial release

## settings
- to connect to the mower type in email and password from your worx account in the Config.
## License
MIT License

Copyright (c) 2019 MeisterTR

## second mower
-If two mowers are to be integrated, a second instance must be installed, one is selected in the Config mower 0 and in the second mower 1 and so on.
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:

## Changelog
#### 0.0.1
* (MeisterTR) initial release
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.
1 change: 1 addition & 0 deletions admin/admin.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
declare let systemDictionary: Record<string, Record<string, string>>;
123 changes: 41 additions & 82 deletions admin/index_m.html
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
<html>

<head>
<!-- these 4 files always have to be included -->
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">

<!-- Load ioBroker scripts and styles-->
<link rel="stylesheet" type="text/css" href="../../css/adapter.css" />
<link rel="stylesheet" type="text/css" href="../../lib/css/materialize.css">

<script type="text/javascript" src="../../lib/js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="../../socket.io/socket.io.js"></script>

<!-- these files always have to be included -->
<script type="text/javascript" src="../../js/translate.js"></script>
<script type="text/javascript" src="../../lib/js/materialize.js"></script>
<script type="text/javascript" src="../../js/adapter-settings.js"></script>

<!-- Load our own files -->
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="words.js"></script>
<style>
.m .col .select-wrapper + label {
top: -26px;
}

.m span {
font-size: 0.9em;
}
</style>
<!-- you have to define 2 functions in the global scope: -->
<script type="text/javascript">
// the function loadSettings has to exist ...
// This will be called by the admin adapter when the settings page loads
function load(settings, onChange) {
// example: select elements with id=key and class=value and insert value
if (!settings) return;
Expand All @@ -32,23 +27,23 @@
var id = $key.attr('id');
if ($key.attr('type') === 'checkbox') {
// do not call onChange direct, because onChange could expect some arguments
$key.prop('checked', settings[id]).change(function () {
onChange();
});
$key.prop('checked', settings[id])
.on('change', () => onChange())
;
} else {
// do not call onChange direct, because onChange could expect some arguments
$key.val(settings[id]).change(function () {
onChange();
}).keyup(function () {
onChange();
});
$key.val(settings[id])
.on('change', () => onChange())
.on('keyup', () => onChange())
;
}
});
onChange(false);
M.updateTextFields(); // function Materialize.updateTextFields(); to reinitialize all the Materialize labels on the page if you are dynamically adding inputs.
// reinitialize all the Materialize labels on the page if you are dynamically adding inputs:
if (M) M.updateTextFields();
}
// ... and the function save has to exist.
// you have to make sure the callback is called with the settings object as first param!

// 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
var obj = {};
Expand All @@ -63,72 +58,36 @@
callback(obj);
}
</script>

</head>

<body>
<!-- you have to put your config page in a div with id adapter-container -->

<div class="m adapter-container">
<div class="row">
<div class="row">
<div class="col s12 m2 l1">
<img src="landroid.png" class="logo">

</div>
<div class="col s12 m8 l10">
<h6 class="translate">title</h6>
</div>
<div class="col s12 m4 l2">
<img src="worx.png" class="logo">
</div>
<div class="divider"></div>
<div class="row" style="background-color: #2196f3;">
<div class="col s12">
<span class="translate">connection settings</span>
<!-- Important: span must come directly after checkbox input (only by checkbox the span will be used!) -->
</div>
</div>
<div class="row">
<div class="input-field col s12">
<input class="value" id="email" type="text" />
<label for="email" class="translate">e-mail</label>
</div>
</div>
<div class="row">
<div class="input-field col s12 m4 l2">
<input type="text" class="value" id="pwd" />
<label for="pwd" class="translate">password</label>

</div>

<div class="input-field col s1 m1">
<select class="value" id="dev_sel">
<option value=0>0</option>
<option value=1>1</option>
<option value=2>2</option>
<option value=3>3</option>
</select>
<label for="dev_sel" class="translate">mower select</label>
<!-- Important: label must come directly after select. Label is important. -->
</div>
</div>
<div class="divider"></div>
<div class="row" style="background-color: #2196f3;">
<div class="col s12">
<span class="translate">additional settings</span>
<!-- Important: span must come directly after checkbox input (only by checkbox the span will be used!) -->
</div>
</div>
<!-- For example columns with settings: -->
<div class="row">

</div>
<div class="row">
<div class="col s12">
<input class="value" id="enableJson" type="checkbox" /><span class="translate">add raw data</span>
<!-- Important: span must come directly after checkbox input (only by checkbox the span will be used!) -->
</div>
<div class="col s12">
<input class="value" id="houerKm" type="checkbox" /><span class="translate">Distance and time in min and m</span>
<!-- Important: span must come directly after checkbox input (only by checkbox the span will be used!) -->
</div>
</div>
<div class="col s6 input-field">
<input type="text" class="value" id="mail" />
<label for="mail" class="translate">e-mail adress</label>
</div>
<div class="col s6 input-field">
<input type="text" class="value" id="password" />
<label for="password" class="translate">Type your pw</label>
</div>
<div class="col s6 input-field">
<input type="number" class="value" id="mower" />
<label for="mower" class="translate">option3 description</label>
</div>
</div>

</div>

</body>
</html>

</html>
3 changes: 0 additions & 3 deletions admin/readme.md

This file was deleted.

10 changes: 10 additions & 0 deletions admin/style.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/* You can delete those if you want. I just found them very helpful */
* {
box-sizing: border-box
}
.m {
/* Don't cut off dropdowns! */
overflow: initial;
}

/* Add your styles here */
7 changes: 7 additions & 0 deletions admin/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../tsconfig.json",
"include": [
"./**/*.d.ts",
"./**/*.js"
]
}
Loading

0 comments on commit ffff159

Please sign in to comment.