Skip to content

Commit

Permalink
stable release
Browse files Browse the repository at this point in the history
  • Loading branch information
bowao committed Jan 5, 2020
1 parent 0d29e3c commit 93c4c36
Show file tree
Hide file tree
Showing 35 changed files with 1,665 additions and 2 deletions.
35 changes: 35 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": "eslint:recommended",
"rules": {
"indent": [
"error",
4,
{
"SwitchCase": 1
}
],
"no-console": "off",
"no-var": "error",
"prefer-const": "error",
"quotes": [
"error",
"single",
{
"avoidEscape": true,
"allowTemplateLiterals": true
}
],
"semi": [
"error",
"always"
]
},
"parserOptions": {
"ecmaVersion": 2018
}
}
32 changes: 32 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
name: Bug report
about: Something is not working as it should
title: ''
labels: ''
assignees: ''
---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '...'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots & Logfiles**
If applicable, add screenshots and logfiles to help explain your problem.

**Versions:**
- Adapter version: <adapter-version>
- JS-Controller version: <js-controller-version> <!-- determine this with `iobroker -v` on the console -->
- Node version: <node-version> <!-- determine this with `node -v` on the console -->
- Operating system: <os-name>

**Additional context**
Add any other context about the problem here.
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.git
.idea
*.code-workspace
node_modules
nbproject

# npm package files
iobroker.*.tgz

Thumbs.db

# i18n intermediate files
admin/i18n/flat.txt
admin/i18n/*/flat.txt
28 changes: 28 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.git
.idea
node_modules/
nbproject/
.vs*/
*.code-workspace
Thumbs.db
gulpfile.js

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

.eslintrc.json
.eslintrc.js

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

# i18n intermediate files
admin/i18n

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

language: node_js
node_js:
- '8'
- '10'

env:
- CXX=g++-4.8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- 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
script:
- npm run test:package
- npm run test:unit
- export DEBUG=testing:*
- npm run test:integration
2 changes: 1 addition & 1 deletion LICENSE
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2020 bowao
Copyright (c) 2019 bowao

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 Down
128 changes: 127 additions & 1 deletion README.md
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,2 +1,128 @@
![Logo](admin/epson_xp860.png)
# ioBroker.epson_xp860
Reads the ink level from the epson xp860 printer website
(German version see below)

## Description
This is more an adapter-like helper script than a real adapter. Because the printer does not support the snmp-standard-printer-MIB, the ink status of the Epson XP860 is read from the printer's Web site. (Only if the printer is set to German)

It is an adaptation of the iobroker.epson_stylus_px830 adapter developed by Pix--.
-> https://github.com/Pix---/ioBroker.epson_stylus_px830

Now it reads the ink levels of an **Epson Expression Photo XP-860** and in addition, it was converted into a **scheduled adapter**

![alt text](img/printer_website_1.png "Website of EPSON Expression Photo XP-860")

![alt text](img/printer_website_2.png "Website of EPSON Expression Photo XP-860")

## Configuration
### IP / Port
IP adress of Epson Printer within local network. The adapter will stop if no IP is entered. The port number is optional and will only be considered if an ip adress is entered.

![Screenshot Settings](img/epson_xp860SettingScreenshot.jpg "Screenshot Settings")

## Schedule
The reading interval of the ink level can be set via the scheduling on the 'Instances' page. Default is every full hour.

![Screenshot Schedule](img/epson_xp860ScheduleScreenshot.jpg "Screenshot Schedule")

## Datapoints

ink_black
ink_cyan
ink_cyanlight
ink_magenta
ink_magentalight
ink_yellow
printerInfo.connection (type of connection, WLAN,LAN)
printerInfo.ip
printerInfo.mac
printerInfo.model
printerInfo.name
printerInfo.requestResponded (True if printer responded on last request)
printerInfo.responseTime (Response time of last request)

## VIS
### Widget
Example set of widgets for VIS (developed by Pix--)
https://raw.githubusercontent.com/bowao/ioBroker.epson_xp860/master/widgets/ink_widget

![alt text](img/VISScreenshot.png "Example VIS Widgets")

## Beschreibung
Dies ist eher ein Adapter-ähnliches Hilfsskript als ein echter Adapter. Da der Drucker die snmp-standard-printer-MIB nicht unterstützt, wird der Tintenstatus des Epson XP860 von der Website des Druckers gelesen. (Nur wenn der Drucker auf Deutsch eingestellt ist)

Dies ist eine Adaption des Adapters iobroker.epson_stylus_px830 entwickelt von Pix--
-> https://github.com/Pix---/ioBroker.epson_stylus_px830

Nun liest der Adapter den Füllstand der Tintenpatronen eines **Epson Expression Photo XP-860** und zusätzlich wurde er zu einem **Zeitgesteuerten-Adapter** umgebaut.

![alt text](img/printer_website_1.png "Website of EPSON Expression Photo XP-860")

![alt text](img/printer_website_2.png "Website of EPSON Expression Photo XP-860")

## Einstellungen
### IP / Port
Die IP Adresse des Druckers im lokalen Netzwerk. Ohne Eingabe gibt es keine Abfrage. Die Portnummer ist optional und wird nur bei Eingabe einer IP-Adresse berücksichtigt.

### Schedule
Der Abfrageintervall kann auf der Seite 'Instanzen' über die Spalte 'Zeitplanung' angepasst werden. Standardeinstellung: zu jeder vollen Stunde.

## Konfiguration
![alt text](img/epson_xp860SettingScreenshot.jpg "Screenshot Einstellungen")

## Datenpunkte

ink_black
ink_cyan
ink_cyanlight
ink_magenta
ink_magentalight
ink_yellow
printerInfo.connection (Verbindungsart WLAN,LAN)
printerInfo.ip
printerInfo.mac
printerInfo.model
printerInfo.name
printerInfo.requestResponded (Wahr, wenn der Drucker auf die letzte Anfrage geantwortet hat)
printerInfo.responseTime (Antwortzeit der letzten Anfrage)


## VIS
### Widget
Beispiel widgets für VIS (entwickelt von Pix--)
https://raw.githubusercontent.com/bowao/ioBroker.epson_xp860/master/widgets/ink_widget

![alt text](img/VISScreenshot.png "Example VIS Widgets")


## Changelog

### 1.0.0
* stable release

## License

The MIT License (MIT)

Copyright (c) 2019 bowao

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.

---

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>>;
44 changes: 44 additions & 0 deletions admin/custom_m.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script type="text/x-iobroker" data-template-name="template">
<div class="row">
<div class="col s2">
<input type="checkbox" data-field="enabled" data-default="false"/>
<!-- this field is mandatory, just to find out if to include this settings or not</span-->
<span class="translate">enabled</span>
</div>
<div class="col s4">
<input type="text" data-field="interval" size="30">
<span class="translate">period of time</span>
</div>
<div class="col s4">
<input type="text" data-field="state" size="30">
<span class="translate">new state</span>
</div>
<div class="col s2">
<input type="checkbox" data-field="setAck" data-default="false">
<span class="translate">ack</span>
</div>
</div>
</script>

<script type="text/javascript">
$.get("adapter/template/words.js", function(script) {
let translation = script.substring(script.indexOf('{'), script.length);
translation = translation.substring(0, translation.lastIndexOf(';'));
$.extend(systemDictionary, JSON.parse(translation));
});

// There are two ways how to predefine default settings:
// - with attribute "data-default" (content independent)
// - with function in global variable "defaults". Function name is equal with adapter name.
// as input function receives object with all information concerning it
if (typeof defaults !== 'undefined') {
defaults["template"] = function (obj, instanceObj) {
return {
enabled: false,
interval: '5m',
state: false,
setAck: false
};
}
}
</script>
Binary file added admin/epson_xp860.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 93c4c36

Please sign in to comment.