Skip to content

Commit a49f3c8

Browse files
Rotzbuanurikk
authored andcommitted
chore(code-style): run prettier
1 parent fb1c7c9 commit a49f3c8

File tree

5 files changed

+14
-9
lines changed

5 files changed

+14
-9
lines changed

src/components/device-image/index.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ const getZ2mDeviceImage = (device: Device): string =>
1919
`https://www.zigbee2mqtt.io/images/devices/${sanitizeZ2MDeviceName(device?.definition?.model)}.jpg`;
2020
const getConverterDeviceImage = (device: Device): string | undefined => device.definition?.icon;
2121

22+
/* prettier-ignore */
2223
const AVAILABLE_GENERATORS: ImageGeneratorFn[] = [
2324
getConverterDeviceImage,
2425
getZ2mDeviceImage,

src/components/device-page/bind-row.tsx

+9-5
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,17 @@ export class BindRow extends Component<BindRowProps, BindRowState> {
130130

131131
const possibleClusters: Set<Cluster> = new Set(stateRule.clusters);
132132
const srcEndpoint = device.endpoints[stateRule.source.endpoint];
133-
const dstEndpoint = (stateRule.target.type === 'endpoint' && stateRule.target.endpoint) ?
134-
(target as Device)?.endpoints[stateRule.target.endpoint] : undefined;
135-
const allClustersValid = stateRule.target.type === 'group' || (target as Device)?.type == "Coordinator";
133+
const dstEndpoint =
134+
stateRule.target.type === 'endpoint' && stateRule.target.endpoint
135+
? (target as Device)?.endpoints[stateRule.target.endpoint]
136+
: undefined;
137+
const allClustersValid = stateRule.target.type === 'group' || (target as Device)?.type == 'Coordinator';
136138
if (srcEndpoint && (dstEndpoint || allClustersValid)) {
137139
for (const cluster of [...srcEndpoint.clusters.input, ...srcEndpoint.clusters.output]) {
138-
const supportedInputOutput = srcEndpoint.clusters.input.includes(cluster) && dstEndpoint?.clusters.output.includes(cluster);
139-
const supportedOutputInput = srcEndpoint.clusters.output.includes(cluster) && dstEndpoint?.clusters.input.includes(cluster);
140+
const supportedInputOutput =
141+
srcEndpoint.clusters.input.includes(cluster) && dstEndpoint?.clusters.output.includes(cluster);
142+
const supportedOutputInput =
143+
srcEndpoint.clusters.output.includes(cluster) && dstEndpoint?.clusters.input.includes(cluster);
140144
if (supportedInputOutput || supportedOutputInput || allClustersValid) {
141145
possibleClusters.add(cluster);
142146
}

src/components/features/composite/FeatureWrapper.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const FeatureWrapper: FunctionComponent<PropsWithChildren<FeatureWrapperP
1616
const isColor = isColorFeature(feature);
1717
const isReadable = (feature.property && feature.access & FeatureAccessMode.ACCESS_READ) || isColor;
1818

19-
const parentFeature = props.parentFeatures?.[props.parentFeatures.length - 1]
19+
const parentFeature = props.parentFeatures?.[props.parentFeatures.length - 1];
2020
let label = feature.label;
2121
if (parentFeature?.label && feature.name === 'state' && !['light', 'switch'].includes(parentFeature.type)) {
2222
label = `${parentFeature.label} ${feature.label.charAt(0).toLowerCase()}${feature.label.slice(1)}`;

src/i18n/LocalePicker.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const localesMap = {
3939
ptbr,
4040
es,
4141
ua,
42-
"zh-CN": chs,
42+
'zh-CN': chs,
4343
nl,
4444
it,
4545
zh,
@@ -49,7 +49,7 @@ const localesMap = {
4949
sv,
5050
tr,
5151
no,
52-
da,
52+
da,
5353
bg,
5454
};
5555

ws.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function startServer() {
99
wss.on('connection', (ws) => {
1010
const messages = JSON.parse(fs.readFileSync('./ws-messages/onConnect.json'));
1111

12-
messages.forEach(message => {
12+
messages.forEach((message) => {
1313
ws.send(JSON.stringify(message));
1414
});
1515

0 commit comments

Comments
 (0)