Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonoff: improve device compliance #627

Merged
merged 34 commits into from Mar 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
efced1e
Sonoff: improve pow device and mqtt topics
atrovato Dec 8, 2019
6619557
Sonoff: manage Dual R2
atrovato Dec 8, 2019
ba53efa
Sonoff: dual R2 setValue Power1/2
atrovato Dec 9, 2019
d5d167f
Sonoff: add arilux-lc01 device
atrovato Dec 14, 2019
2df72b6
Sonoff: split methods
atrovato Dec 14, 2019
6a58411
Sonoff: improve test coverage
atrovato Dec 14, 2019
cfb91fe
Sonoff: refactor device list
atrovato Dec 20, 2019
02d8f10
Sonoff: manage Sonoff SV device
atrovato Dec 20, 2019
4fbb1ee
Sonoff: manage Sonoff Dual device
atrovato Dec 20, 2019
53d1c84
Sonoff: manage 4CH device
atrovato Dec 20, 2019
29e65f6
Sonoff: rename device files
atrovato Dec 20, 2019
45eaeec
Sonoff: manage Slampher device
atrovato Dec 20, 2019
3a392e0
Sonoff: manage Sonoff Touch device
atrovato Dec 20, 2019
5a0f247
Sonoff: manage Sonoff LED device
atrovato Dec 20, 2019
b7d5269
Sonoff: manage 1/4 Channel devices
atrovato Dec 20, 2019
6e47d84
Sonoff: fix device discover
atrovato Dec 24, 2019
3523c90
Sonoff: edit device features
atrovato Jan 3, 2020
5813e7b
Sonoff: delete manual creation
atrovato Jan 3, 2020
332b487
Sonoff: refactor device box
atrovato Jan 3, 2020
cd8ec18
Sonoff: fix typo
atrovato Jan 3, 2020
5a98ff4
Sonoff: refactor device and handle updates
atrovato Jan 4, 2020
cd67998
Sonoff: fix refactor impacts
atrovato Jan 4, 2020
62d1f02
Sonoff: manage not managed device
atrovato Jan 4, 2020
5ada018
Sonoff: oops - fix tests
atrovato Jan 4, 2020
8ab363b
Sonoff to Tasmota
atrovato Jan 4, 2020
38b24b9
Tasmota: add more devices
atrovato Jan 4, 2020
e4fb058
Tasmota: refactor feature discovering
atrovato Jan 7, 2020
dd8fc16
Tasmota: dynamic discover
atrovato Jan 12, 2020
ef6cf03
Tasmota: add components
atrovato Jan 12, 2020
f044660
Tasmota: improve UI
atrovato Jan 13, 2020
fa6cc48
Tasmota: fix feature label and icon
atrovato Jan 15, 2020
64bb8b1
Tasmota: display featuren name
atrovato Jan 15, 2020
463acd7
Tasmota: remove front pagination
atrovato Mar 9, 2020
32ff778
Tasmota: rollback dashboard display
atrovato Mar 9, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.