Skip to content

Commit

Permalink
Sending fake user-agent
Browse files Browse the repository at this point in the history
  • Loading branch information
DEV2DEV-DE committed Dec 13, 2023
1 parent f0eed64 commit 8ad170c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ You need to re-enter your password in the instance settings if you already used
### **WORK IN PROGRESS**
* Improved readability
* Select data segments read from server
* Changed User-Agent in requests

### 0.1.0 (2023-12-10)
* Fixed issue with restarts due to timeouts
Expand Down
4 changes: 3 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ const utils = require('@iobroker/adapter-core');
const axios = require('axios').default;

const baseUrl = 'https://api.jablonet.net/api/2.2';
const userAgent = 'Mozilla/5.0 (iPhone13,2; U; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Mobile/15E148 Safari/602.1';
const headers = {
'x-vendor-id': 'JABLOTRON:Jablotron',
'Content-Type': 'application/json',
'x-client-version': 'MYJ-PUB-ANDROID-12',
'accept-encoding': '*',
'Accept': 'application/json',
'Accept-Language': 'en'
'Accept-Language': 'en',
'User-Agent': userAgent
};

class Jablotron extends utils.Adapter {
Expand Down

0 comments on commit 8ad170c

Please sign in to comment.