Skip to content

Commit

Permalink
added doc for http
Browse files Browse the repository at this point in the history
  • Loading branch information
claudio-petrini committed May 13, 2020
1 parent be4401b commit 122fcd1
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 10 deletions.
9 changes: 8 additions & 1 deletion devices/docgen/docgen.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const fs = require('fs');
const path = require('path');
const zigbeeDevices = require('zigbee-herdsman-converters').devices;
const modbusDevices = require('@instathings/modbus-herdsman-converters').devices;
const httpDevices = require('@instathings/http-herdsman-converters').devices;

const supportDevicesFn = require('./supported-devices');
const utils = require('./utils');
Expand All @@ -13,10 +14,16 @@ const pages = [
id: 'zigbee-devices',
protocol: 'Zigbee',
devices: zigbeeDevices
}, {
},
{
id: 'modbus-devices',
protocol: 'Modbus',
devices: modbusDevices
},
{
id: 'http-devices',
protocol: 'HTTP',
devices: httpDevices
}
]

Expand Down
3 changes: 1 addition & 2 deletions devices/docgen/supported-devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ title: Supported ${protocol} devices
</style>
Currently:
- **${devices.length}** ${protocol} devices are supported from **${vendorCount}** different vendors.
Currently **${devices.length}** ${protocol} devices are supported from **${vendorCount}** different vendors.
<div class="main-content-devices" role="main">
Expand Down
Binary file added devices/docs/images/devices/SHBLB.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added devices/docs/images/devices/SHPLG-S.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 36 additions & 0 deletions docs/http-devices.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
id: http-devices
title: Supported HTTP devices
---

<style type="text/css">
.main-content-devices table {
table-layout: fixed;
display: table !important;
}
.main-content-devices table tr th:nth-child(1) {
width: 15%;
}
.main-content-devices table tr th:nth-child(2) {
width: 60%;
}
.main-content-devices table tr th:nth-child(3) {
width: 25%;
}

</style>

Currently **2** HTTP devices are supported from **1** different vendors.

<div class="main-content-devices" role="main">

## Shelly

| Model | Description | Picture |
| ------------- | ------------- | -------------------------- |
| SHPLG-S | Shelly Smart Plug - Power meter (on/off, power measurement) | ![./assets/devices/SHPLG-S.jpg](./assets/devices/SHPLG-S.jpg) |
| SHBLB | Shelly E27 Smart bulb with Red, Green, Blue and White LEDs. ( on/off, brightness, color rgb) | ![./assets/devices/SHBLB.jpg](./assets/devices/SHBLB.jpg) |



</div>
3 changes: 1 addition & 2 deletions docs/modbus-devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ title: Supported Modbus devices

</style>

Currently:
- **2** Modbus devices are supported from **2** different vendors.
Currently **2** Modbus devices are supported from **2** different vendors.

<div class="main-content-devices" role="main">

Expand Down
3 changes: 1 addition & 2 deletions docs/zigbee-devices.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@ title: Supported Zigbee devices

</style>

Currently:
- **728** Zigbee devices are supported from **126** different vendors.
Currently **728** Zigbee devices are supported from **126** different vendors.

<div class="main-content-devices" role="main">

Expand Down
12 changes: 11 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"docgen": "node devices/docgen/docgen.js && cp -R devices/docs/images/devices docs/assets"
},
"devDependencies": {
"@instathings/http-herdsman-converters": "^1.0.5",
"@instathings/modbus-herdsman-converters": "2.0.3",
"docusaurus": "^1.14.4",
"zigbee-herdsman": "0.12.83",
Expand All @@ -19,4 +20,4 @@
"dependencies": {
"json2yaml": "^1.1.0"
}
}
}
3 changes: 3 additions & 0 deletions website/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
"title": "Working with Zigbee 🐝",
"sidebar_label": "Working with Zigbee"
},
"http-devices": {
"title": "Supported HTTP devices"
},
"modbus-devices": {
"title": "Supported Modbus devices"
},
Expand Down
4 changes: 3 additions & 1 deletion website/pages/en/protocols.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const React = require('react');
const zigbeeDevices = require('zigbee-herdsman-converters').devices;
const modbusDevices = require('@instathings/modbus-herdsman-converters').devices;
const httpDevices = require('@instathings/http-herdsman-converters').devices;

const CompLibrary = require('../../core/CompLibrary.js');

Expand All @@ -14,11 +15,12 @@ class Protocols extends React.Component {
}

const showcase = siteConfig.protocols.map(protocol => (
<a target={protocol.externalLink ? '_blank' : undefined} style={{ width: '33%' }} className="link" href={protocol.infoLink} key={protocol.infoLink}>
<a target={protocol.externalLink ? '_blank' : undefined} style={{ width: '25%' }} className="link" href={protocol.infoLink} key={protocol.infoLink}>
<img src={protocol.image} alt={protocol.caption} title={protocol.caption} />
<br />
{protocol.id === 'zigbee' && <span>{zigbeeDevices.length} </span>}
{protocol.id === 'modbus' && <span>{modbusDevices.length} </span>}
{protocol.id === 'http' && <span>{httpDevices.length} </span>}
<span className="caption">
{protocol.caption} devices
</span>
Expand Down
10 changes: 10 additions & 0 deletions website/siteConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ const protocols = [
write: false,
},
pinned: true,
}, {
id: 'http',
caption: 'HTTP',
image: '/docs/assets/all-devices/http.png',
infoLink: '/docs/http-devices.html',
options: {
read: true,
write: true,
},
pinned: true,
},
{
id: 'knx',
Expand Down

0 comments on commit 122fcd1

Please sign in to comment.