Skip to content

Commit

Permalink
Update v1.5.20231013
Browse files Browse the repository at this point in the history
  • Loading branch information
Wilkware committed Oct 14, 2023
1 parent 817ced8 commit e6998fe
Show file tree
Hide file tree
Showing 21 changed files with 1,955 additions and 327 deletions.
2 changes: 1 addition & 1 deletion .style
Submodule .style updated 4 files
+3 −5 .php-cs-fixer.php
+139 −0 .php-json-fixer.php
+0 −183 .php_cs
+29 −10 README.md
14 changes: 13 additions & 1 deletion Blink Home Client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Version](https://img.shields.io/badge/Symcon-PHP--Modul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Product](https://img.shields.io/badge/Symcon%20Version-6.0-blue.svg)](https://www.symcon.de/produkt/)
[![Version](https://img.shields.io/badge/Modul%20Version-1.3.20220620-orange.svg)](https://github.com/Wilkware/IPSymconBlink)
[![Version](https://img.shields.io/badge/Modul%20Version-1.5.20231013-orange.svg)](https://github.com/Wilkware/IPSymconBlink)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Actions](https://github.com/Wilkware/IPSymconBlink/workflows/Check%20Style/badge.svg)](https://github.com/Wilkware/IPSymconBlink/actions)

Expand Down Expand Up @@ -122,6 +122,18 @@ Die Funktion liefert '1' im Erfolgsfall, sonst '0'.

### 8. Versionshistorie

v1.5.20231013

* _FIX_: Übersetzungen ausgebaut bzw. vervollständigt
* _FIX_: Blink API Layer erweitert, aktualisiert und neu dokumentiert
* _FIX_: Style-Checks aktualisiert
* _FIX_: Interne Bibliotheken überarbeitet und vereinheitlicht
* _FIX_: Dokumentation überarbeitet

v1.4.20220815

* _FIX_: API für Blink Doorbells angeasst

v1.3.20220620

* _NEU_: Login überarbeitet, jeder Client hat jetzt eigene UUID
Expand Down
181 changes: 139 additions & 42 deletions Blink Home Client/form.json

Large diffs are not rendered by default.

28 changes: 23 additions & 5 deletions Blink Home Client/locale.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,30 @@
"The user email must not be empty!": "Die Benutzer eMail darf nicht leer sein!",
"The password must not be empty!": "Das Passwort darf nicht leer sein!",
"You must verify your registration!": "Sie müssen Ihre Anmeldung verifizieren!",
"Use the button to obtain account notification flags ...": "Verwenden Sie diese Schaltfläche, um die Benachrichtigungsoptionen abzurufen ...",
"Options":"Optionen",
"ON":"AN",
"OFF":"AUS",
"Use this button to access all notification flags ...": "Verwenden Sie diese Schaltfläche, um alle Benachrichtigungsflags abzurufen ...",
"Options": "Optionen",
"ON": "AN",
"OFF": "AUS",
"YES": "JA",
"NO": "NEIN",
"hours": "Stunden",
"Low battery: %s\nCamera offline: %s\nCamera usage: %s\nScheduling (On/Off): %s\nMotion: %s\nSync module offline: %s\nHigh temperature: %s\nDoorbell: %s\nWifi: %s\nLost frame received: %s\nBandwidth: %s\nBattery dead: %s\nLocal storage: %s\nAccessory connected: %s\nAccessory disconnected: %s\nAccessory low battery: %s\nGeneral: %s": "Niedrieger Batteriestand: %s\nKamera offline: %s\nHohe Kameranutzung: %s\nZeitpläne (On/Off): %s\nBewegungserkennung: %s\nSync-Modul offline: %s\nHohe Kameratemperatur: %s\nDrücken der Türklingel: %s\nWiFi: %s\nVerlorener Frame empfangen (LFR): %s\nBandbreite: %s\nBatterie entladen: %s\nLokaler Speicher: %s\nZubehör verbunden: %s\nZubehör entfernt: %s\nZubehör niedrieger Batteriestand: %s\nAllgemein: %s",
"Low battery": "Niedrieger Batteriestand",
"Camera offline": "Kamera offline",
"Camera usage": "Hohe Kameranutzung",
"Scheduling (On/Off)": "Zeitpläne (On/Off)",
"Motion": "Bewegungserkennung",
"Sync module offline": "Sync-Modul offline",
"High temperature": "Hohe Kameratemperatur",
"Doorbell": "Türklingelbetätigung",
"Wifi": "WiFi",
"Lost frame received": "Verlorener Frame empfangen (LFR)",
"Bandwidth": "Bandbreite",
"Battery dead": "Batterie entladen",
"Local storage": "Lokaler Speicher",
"Accessory connected": "Zubehör verbunden",
"Accessory disconnected": "Zubehör entfernt",
"Accessory low battery": "Zubehör niedrieger Batteriestand",
"System offline": "System offline",
"Source code, donation and licence ...": "Quellcode, Spende und Lizenz ...",
"The software is free of charge for non-commercial use, I would appreciate a donation if you like the module.": "Die Software ist für die nicht kommzerielle Nutzung kostenlos, über eine Spende bei Gefallen des Moduls würde ich mich sehr freuen."
}
Expand Down
98 changes: 72 additions & 26 deletions Blink Home Client/module.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,29 @@ class BlinkHomeClient extends IPSModule
// Helper Traits
use BlinkHelper;
use DebugHelper;
use EventHelper;
use FormatHelper;

// Echo maps
private const BLINK_MAP_NOTIFICATIONS = [
['low_battery', 'Low battery', 5],
['camera_offline', 'Camera offline', 5],
['camera_usage', 'Camera usage', 5],
['scheduling', 'Scheduling (On/Off)', 5],
['motion', 'Motion', 5],
['sync_module_offline', 'Sync module offline', 5],
['temperature', 'High temperature', 5],
['doorbell', 'Doorbell', 5],
['wifi', 'Wifi', 5],
['lfr', 'Lost frame received', 5],
['bandwidth', 'Bandwidth', 5],
['battery_dead', 'Battery dead', 5],
['local_storage', 'Local storage', 5],
['accessory_connected', 'Accessory connected', 5],
['accessory_disconnected', 'Accessory disconnected', 5],
['accessory_low_battery', 'Accessory low battery', 5],
['general', 'System offline', 5],
];

/**
* Overrides the internal IPSModule::Create($id) function
Expand Down Expand Up @@ -151,6 +174,18 @@ public function ForwardData($json)
$result = $this->doDisarm($token, $region, $account, $params['NetworkID']);
}
break;
case 'network':
$params = (array) $data['Params'];
if (isset($params['NetworkID'])) {
$result = $this->doNetwork($token, $region, $params['NetworkID']);
}
break;
case 'local_storage_status':
$params = (array) $data['Params'];
if (isset($params['NetworkID']) && isset($params['DeviceID'])) {
$result = $this->doLocalStorageStatus($token, $region, $account, $params['NetworkID'], $params['DeviceID']);
}
break;
case 'image':
$params = (array) $data['Params'];
if (isset($params['Path'])) {
Expand All @@ -166,8 +201,8 @@ public function ForwardData($json)
break;
case 'motion':
$params = (array) $data['Params'];
if (isset($params['NetworkID']) && isset($params['DeviceID']) && isset($params['Detection'])) {
$result = $this->doMotion($token, $region, $params['NetworkID'], $params['DeviceID'], $params['Detection']);
if (isset($params['NetworkID']) && isset($params['DeviceID']) && isset($params['DeviceType']) && isset($params['Detection'])) {
$result = $this->doMotion($token, $region, $account, $params['NetworkID'], $params['DeviceID'], $params['DeviceType'], $params['Detection']);
}
break;
case 'command':
Expand All @@ -176,9 +211,41 @@ public function ForwardData($json)
$result = $this->doCommand($token, $region, $params['NetworkID'], $params['CommandID']);
}
break;
default:
$this->SendDebug(__FUNCTION__, 'Invalid Command: ' . $data['Endpoint']);
case 'liveview':
$params = (array) $data['Params'];
if (isset($params['NetworkID']) && isset($params['DeviceID']) && isset($params['DeviceType'])) {
$result = $this->doLive($token, $region, $account, $params['NetworkID'], $params['DeviceID'], $params['DeviceType']);
}
break;
case 'events':
$params = (array) $data['Params'];
if (isset($params['Timestamp']) && isset($params['Page'])) {
$result = $this->doEvents($token, $region, $account, $params['Timestamp'], $params['Page']);
}
break;
case 'manifest':
$params = (array) $data['Params'];
if (isset($params['NetworkID']) && isset($params['DeviceID'])) {
$result = $this->doManifest($token, $region, $account, $params['NetworkID'], $params['DeviceID']);
}
break;
case 'clip':
$params = (array) $data['Params'];
if (isset($params['NetworkID']) && isset($params['DeviceID']) && isset($params['ManifestID']) && isset($params['ClipID'])) {
$result = $this->doClip($token, $region, $account, $params['NetworkID'], $params['DeviceID'], $params['ManifestID'], $params['ClipID']);
$encode = true;
}
break;
case 'video':
$params = (array) $data['Params'];
if (isset($params['MediaID'])) {
$result = $this->doVideo($token, $region, $params['MediaID']);
$encode = true;
}
break;
default:
$this->SendDebug(__FUNCTION__, 'Invalid Command: ' . $data['Endpoint']);
break;
}
}
$this->SendDebug(__FUNCTION__, $result);
Expand Down Expand Up @@ -363,28 +430,7 @@ public function Notification()
$params = json_decode($response, true);
$this->SendDebug(__FUNCTION__, $params);
// Prepeare Info
$format = $this->Translate("Low battery: %s\nCamera offline: %s\nCamera usage: %s\nScheduling (On/Off): %s\nMotion: %s\nSync module offline: %s\nHigh temperature: %s\nDoorbell: %s\nWifi: %s\nLost frame received: %s\nBandwidth: %s\nBattery dead: %s\nLocal storage: %s\nAccessory connected: %s\nAccessory disconnected: %s\nAccessory low battery: %s\nGeneral: %s");
$info = sprintf(
$format,
$params['notifications']['low_battery'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['camera_offline'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['camera_usage'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['scheduling'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['motion'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['sync_module_offline'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['temperature'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['doorbell'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['wifi'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['lfr'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['bandwidth'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['battery_dead'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['local_storage'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['accessory_connected'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['accessory_disconnected'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['accessory_low_battery'] ? $this->Translate('ON') : $this->Translate('OFF'),
$params['notifications']['general'] ? $this->Translate('ON') : $this->Translate('OFF')
);
echo $info;
echo $this->PrettyPrint(self::BLINK_MAP_NOTIFICATIONS, $params['notifications']);
$ret = self::$BLINK_SUCCESS;
} else {
echo $this->Translate('Call was not successfull!');
Expand Down
14 changes: 13 additions & 1 deletion Blink Home Configurator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Version](https://img.shields.io/badge/Symcon-PHP--Modul-red.svg)](https://www.symcon.de/service/dokumentation/entwicklerbereich/sdk-tools/sdk-php/)
[![Product](https://img.shields.io/badge/Symcon%20Version-6.0-blue.svg)](https://www.symcon.de/produkt/)
[![Version](https://img.shields.io/badge/Modul%20Version-1.3.20220620-orange.svg)](https://github.com/Wilkware/IPSymconBlink)
[![Version](https://img.shields.io/badge/Modul%20Version-1.5.20231013-orange.svg)](https://github.com/Wilkware/IPSymconBlink)
[![License](https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-green.svg)](https://creativecommons.org/licenses/by-nc-sa/4.0/)
[![Actions](https://github.com/Wilkware/IPSymconBlink/workflows/Check%20Style/badge.svg)](https://github.com/Wilkware/IPSymconBlink/actions)

Expand Down Expand Up @@ -74,6 +74,18 @@ Das Modul bietet keine direkten Funktionsaufrufe.

### 8. Versionshistorie

v1.5.20231013

* _FIX_: Übersetzungen ausgebaut bzw. vervollständigt
* _FIX_: Blink API Layer erweitert, aktualisiert und neu dokumentiert
* _FIX_: Style-Checks aktualisiert
* _FIX_: Interne Bibliotheken überarbeitet und vereinheitlicht
* _FIX_: Dokumentation überarbeitet

v1.4.20220815

* _FIX_: API für Blink Doorbells angeasst

v1.3.20220620

* _NEU_: Blink Doorbell Support
Expand Down
Loading

0 comments on commit e6998fe

Please sign in to comment.