Skip to content

Commit

Permalink
Rename Sonoff to Tasmota & improve device compliance (GladysAssistant…
Browse files Browse the repository at this point in the history
…#627)

* Sonoff: improve pow device and mqtt topics

* Sonoff: manage Dual R2

* Sonoff: dual R2 setValue Power1/2

* Sonoff: add arilux-lc01 device

* Sonoff: split methods

* Sonoff: improve test coverage

* Sonoff: refactor device list

* Sonoff: manage Sonoff SV device

* Sonoff: manage Sonoff Dual device

* Sonoff: manage 4CH device

* Sonoff: rename device files

* Sonoff: manage Slampher device

* Sonoff: manage Sonoff Touch device

* Sonoff: manage Sonoff LED device

* Sonoff: manage 1/4 Channel devices

* Sonoff: fix device discover

* Sonoff: edit device features

* Sonoff: delete manual creation

* Sonoff: refactor device box

* Sonoff: fix typo

* Sonoff: refactor device and handle updates

* Sonoff: fix refactor impacts

* Sonoff: manage not managed device

* Sonoff: oops - fix tests

* Sonoff to Tasmota

* Tasmota: add more devices

* Tasmota: refactor feature discovering

* Tasmota: dynamic discover

* Tasmota: add components

* Tasmota: improve UI

* Tasmota: fix feature label and icon

* Tasmota: display featuren name

* Tasmota: remove front pagination

* Tasmota: rollback dashboard display
  • Loading branch information
atrovato committed Mar 28, 2020
1 parent f74b837 commit 91145ea
Show file tree
Hide file tree
Showing 139 changed files with 5,568 additions and 1,389 deletions.
Binary file removed front/src/assets/integrations/cover/sonoff.jpg
Binary file not shown.
Binary file added front/src/assets/integrations/cover/tasmota.jpg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 7 additions & 5 deletions front/src/components/app.jsx
Expand Up @@ -73,9 +73,10 @@ import MqttDevicePage from '../routes/integration/all/mqtt/device-page';
import MqttDeviceSetupPage from '../routes/integration/all/mqtt/device-page/setup';
import MqttSetupPage from '../routes/integration/all/mqtt/setup-page';

// Sonoff
import SonoffPage from '../routes/integration/all/sonoff/device-page';
import SonoffDiscoverPage from '../routes/integration/all/sonoff/discover-page';
// Tasmota
import TasmotaPage from '../routes/integration/all/tasmota/device-page';
import TasmotaEditPage from '../routes/integration/all/tasmota/edit-page';
import TasmotaDiscoverPage from '../routes/integration/all/tasmota/discover-page';

const defaultState = getDefaultState();
const store = createStore(defaultState);
Expand Down Expand Up @@ -169,8 +170,9 @@ const AppRouter = connect(
<MqttSetupPage path="/dashboard/integration/device/mqtt/setup" />
<XiaomiPage path="/dashboard/integration/device/xiaomi" />
<EditXiaomiPage path="/dashboard/integration/device/xiaomi/edit/:deviceSelector" />
<SonoffPage path="/dashboard/integration/device/sonoff" />
<SonoffDiscoverPage path="/dashboard/integration/device/sonoff/discover" />
<TasmotaPage path="/dashboard/integration/device/tasmota" />
<TasmotaEditPage path="/dashboard/integration/device/tasmota/edit/:deviceSelector" />
<TasmotaDiscoverPage path="/dashboard/integration/device/tasmota/discover" />

<ChatPage path="/dashboard/chat" />
<MapPage path="/dashboard/maps" />
Expand Down
Expand Up @@ -36,6 +36,8 @@ const SensorDeviceType = ({ children, ...props }) => (
{props.deviceFeature.unit === DEVICE_FEATURE_UNITS.KILOWATT_HOUR && 'kW/h'}
{props.deviceFeature.unit === DEVICE_FEATURE_UNITS.LUX && 'Lx'}
{props.deviceFeature.unit === DEVICE_FEATURE_UNITS.PASCAL && 'Pa'}
{props.deviceFeature.unit === DEVICE_FEATURE_UNITS.AMPERE && 'A'}
{props.deviceFeature.unit === DEVICE_FEATURE_UNITS.VOLT && 'V'}
</span>
)}
</td>
Expand Down
40 changes: 34 additions & 6 deletions front/src/config/demo.json
Expand Up @@ -677,11 +677,12 @@
"configured": true,
"connected": true
},
"get /api/v1/service/sonoff": {},
"get /api/v1/service/sonoff/device": [
"get /api/v1/service/tasmota": {},
"get /api/v1/service/tasmota/device": [
{
"name": "Switch",
"external_id": "sonoff:sonoff-basic",
"external_id": "tasmota:sonoff-basic",
"selector": "sonoff-basic",
"room_id": "cecc52c7-3e67-4b75-9b13-9a8867b0443d",
"model": "sonoff-basic",
"features": [
Expand All @@ -692,10 +693,24 @@
]
}
],
"get /api/v1/service/sonoff/discover": [
"get /api/v1/device/sonoff-basic": {
"name": "Switch",
"external_id": "tasmota:sonoff-basic",
"selector": "sonoff-basic",
"room_id": "cecc52c7-3e67-4b75-9b13-9a8867b0443d",
"model": "sonoff-basic",
"features": [
{
"category": "switch",
"type": "binary",
"name": "Switch"
}
]
},
"get /api/v1/service/tasmota/discover": [
{
"name": "Sonoff Basic Kitchen",
"external_id": "sonoff:sonoff-basic",
"external_id": "tasmota:sonoff-basic",
"created_at": "2019-02-12T07:49:07.556Z",
"model": "sonoff-basic",
"features": [
Expand All @@ -707,14 +722,27 @@
},
{
"name": "Sonoff Pow Kitchen",
"external_id": "sonoff:sonoff-pow",
"external_id": "tasmota:sonoff-pow",
"model": "sonoff-pow",
"features": [
{
"category": "switch",
"type": "binary"
}
]
},
{
"name": "Sonoff Mini Outside",
"external_id": "tasmota:sonoff-mini",
"model": "sonoff-basic",
"created_at": "2019-02-12T07:49:07.556Z",
"updatable": true,
"features": [
{
"category": "switch",
"type": "binary"
}
]
}
],
"get /api/v1/service/rtsp-camera/device": [
Expand Down
42 changes: 22 additions & 20 deletions front/src/config/i18n/en.json
Expand Up @@ -227,41 +227,38 @@
"saveError": "There was an error saving the camera.",
"testConnectionError": "There was an error while getting the RTSP Flux. Are you sure the provided URL is right and accessible from Gladys instance?"
},
"sonoff": {
"title": "Sonoff",
"tasmota": {
"title": "Tasmota",
"deviceTab": "Devices",
"discoverTab": "MQTT discover",
"prepareDeviceDescr": "Or manually prepare future or not discovered devices",
"discoverDeviceDescr": "Automatically scan MQTT devices",
"device": {
"title": "Sonoff devices in Gladys",
"title": "Tasmota devices in Gladys",
"search": "Search devices",
"newButton": "New",
"noDeviceFound": "No Sonoff device found. You can add devices with following actions:"
"editButton": "Edit",
"noDeviceFound": "No Tasmota device found.",
"featuresLabel": "Features"
},
"discover": {
"title": "Sonoff discover devices over MQTT",
"description": "Configured Sonoff devices are automatically discovered over MQTT network.",
"error": "Error discovering Sonoff devices.",
"noDeviceFound": "No Sonoff device discovered.",
"documentation": "Sonoff documentation"
"title": "Tasmota discover devices over MQTT",
"description": "Configured Tasmota devices are automatically discovered over MQTT network.",
"error": "Error discovering Tasmota devices.",
"noDeviceFound": "No Tasmota device discovered.",
"documentation": "Tasmota documentation",
"scan": "Scan"
},
"nameLabel": "Device Name",
"namePlaceholder": "Enter the name of your device",
"roomLabel": "Room",
"topicLabel": "Topic (%topic% Sonoff MQTT)",
"topicPlaceholder": "Should starts with 'sonoff:'",
"modelLabel": "Sonoff Model",
"model": {
"sonoff-basic": "Basic",
"sonoff-pow": "Pow",
"sonoff-s2x": "S20/S26 Smart Plug"
},
"topicLabel": "Tasmota MQTT Topic",
"saveButton": "Save",
"updateButton": "Update",
"alreadyCreatedButton": "Already created",
"deleteButton": "Delete",
"unmanagedModelButton": "Model not managed",
"error": {
"defaultError": "There was an error saving the device.",
"defaultDeletionError": "There was an error deleting the device.",
"conflictError": "Current topic is already in use."
}
},
Expand Down Expand Up @@ -788,7 +785,9 @@
"color": "Light Color",
"saturation": "Light Saturation",
"temperature": "Light Temperature",
"power": "Light Power consumption"
"power": "Light Power consumption",
"effect-mode": "Effect mode",
"effect-speed": "Effect speed"
},
"battery": {
"integer": "Battery"
Expand All @@ -810,6 +809,9 @@
"camera": {
"image": "Camera"
},
"counter-sensor": {
"integer": "Counter"
},
"access-control": {
"mode": "Access Control Mode"
},
Expand Down
8 changes: 4 additions & 4 deletions front/src/config/integrations/device.en.json
Expand Up @@ -30,9 +30,9 @@
"img": "/assets/integrations/cover/philips-hue.jpg"
},
{
"key": "sonoff",
"name": "Sonoff",
"description": "Control your Sonoff devices.",
"img": "/assets/integrations/cover/sonoff.jpg"
"key": "tasmota",
"name": "Tasmota",
"description": "Control your Tasmota devices.",
"img": "/assets/integrations/cover/tasmota.jpg"
}
]
29 changes: 0 additions & 29 deletions front/src/routes/integration/all/sonoff/device-page/EmptyState.jsx

This file was deleted.

0 comments on commit 91145ea

Please sign in to comment.