Skip to content

Commit

Permalink
Add pre-commit, update README
Browse files Browse the repository at this point in the history
  • Loading branch information
amberstarlight committed Jun 26, 2022
1 parent 0a1842c commit 6eece98
Show file tree
Hide file tree
Showing 30 changed files with 82 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

ZIGBEE2MQTT_CONFIG_SERIAL_PORT=/dev/ttyUSB0
ZIGBEE2MQTT_CONFIG_ADVANCED_RTSCTS=false
ZIGBEE2MQTT_CONFIG_PERMIT_JOIN=false
ZIGBEE2MQTT_CONFIG_PERMIT_JOIN=false
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

module.exports = {
env: {
browser: true,
Expand Down
2 changes: 1 addition & 1 deletion .nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ server {
index index.html index.htm;
try_files $uri $uri/ /index.html =404;
}
}
}
20 changes: 20 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.2.0
hooks:
- id: insert-license
files: \.js$
args:
- --license-filepath
- ./license_header.txt
- --comment-style
- // # defaults to: #
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ data
node_modules
coverage
build
*.md
*.md
2 changes: 2 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

module.exports = {
trailingComma: 'es5',
tabWidth: 2,
Expand Down
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
# zigbee-webui

A React web app to control Zigbee-compliant devices.
An alternative frontend for [Zigbee2MQTT](https://www.zigbee2mqtt.io/), using React.

## Contributing

Any changes should be made against a separate branch, and a pull request opened. Please remember to [install the pre-commit hooks](https://pre-commit.com/#install) so these run before you commit changes.

### License

This repository is licensed under the GNU General Public License, version 3 (or at your option, **any later version**).

`SPDX-License-Identifier: GPL-3.0-or-later`
1 change: 1 addition & 0 deletions license_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
SPDX-License-Identifier: GPL-3.0-or-later
2 changes: 1 addition & 1 deletion mosquitto.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ listener 1883
allow_anonymous true

listener 1884
protocol websockets
protocol websockets
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import { useEffect, useState } from 'react';
import * as mqttService from './services/mqttService';
import { Link, Route } from 'wouter';
Expand Down
2 changes: 2 additions & 0 deletions src/components/Button/Button.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import styled from 'styled-components';

const StyledButton = styled.button`
Expand Down
2 changes: 2 additions & 0 deletions src/components/ColorPicker/ColorPicker.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

function ColorPicker(props) {
return (
<>
Expand Down
2 changes: 2 additions & 0 deletions src/components/DeviceCard/DeviceCard.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import { deviceDescription } from '../../utils/deviceUtilities';
import styled from 'styled-components';
import { StyledText, StyledHeader } from '../../utils/theme';
Expand Down
2 changes: 2 additions & 0 deletions src/components/DeviceList/DeviceList.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import { Link } from 'wouter';
import DeviceCard from '../DeviceCard/DeviceCard';

Expand Down
2 changes: 2 additions & 0 deletions src/components/DeviceSettings/DeviceSettings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import { useState, useEffect } from 'react';

import LoadingSpinner from '../LoadingSpinner/LoadingSpinner';
Expand Down
2 changes: 2 additions & 0 deletions src/components/DeviceSettings/generator.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import {
booleanToMqttState,
hexToRGB,
Expand Down
2 changes: 2 additions & 0 deletions src/components/EditableText/EditableText.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import { useState } from 'react';
import styled from 'styled-components';

Expand Down
2 changes: 2 additions & 0 deletions src/components/GlobalStyles/globalStyles.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import '../../font.css';
import { createGlobalStyle } from 'styled-components';

Expand Down
2 changes: 2 additions & 0 deletions src/components/LoadingSpinner/LoadingSpinner.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import styled from 'styled-components';

const Wrapper = styled.div`
Expand Down
2 changes: 2 additions & 0 deletions src/components/Slider/Slider.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import styled from 'styled-components';

const SliderContainer = styled.div`
Expand Down
2 changes: 2 additions & 0 deletions src/components/Toggle/Toggle.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import styled from 'styled-components';

const Switch = styled.label`
Expand Down
2 changes: 2 additions & 0 deletions src/components/UseDarkMode/useDarkMode.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import { useEffect, useState } from 'react';

const prefersDarkTheme = () =>
Expand Down
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Devices/Devices.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import DeviceList from '../../components/DeviceList/DeviceList';
import DeviceSettings from '../../components/DeviceSettings/DeviceSettings';
import LoadingSpinner from '../../components/LoadingSpinner/LoadingSpinner';
Expand Down
2 changes: 2 additions & 0 deletions src/pages/Settings/Settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import * as mqttService from '../../services/mqttService';

import Button from '../../components/Button/Button';
Expand Down
2 changes: 2 additions & 0 deletions src/reportWebVitals.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

const reportWebVitals = (onPerfEntry) => {
if (onPerfEntry && onPerfEntry instanceof Function) {
import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
Expand Down
2 changes: 2 additions & 0 deletions src/services/mqttService.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import mqtt from 'mqtt';
let client;

Expand Down
2 changes: 2 additions & 0 deletions src/utils/deviceUtilities.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import { setDeviceSettings } from '../services/mqttService';

export const mqttStateToBoolean = (state) => {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/theme.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import styled from 'styled-components';

const colours = {
Expand Down
2 changes: 2 additions & 0 deletions src/utils/transformers.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// SPDX-License-Identifier: GPL-3.0-or-later

import Button from '../components/Button/Button';
import Slider from '../components/Slider/Slider';

Expand Down

0 comments on commit 6eece98

Please sign in to comment.