Skip to content

Commit

Permalink
chore(code-style): run prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Rotzbua authored and nurikk committed Oct 4, 2023
1 parent fb1c7c9 commit a49f3c8
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/components/device-image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const getZ2mDeviceImage = (device: Device): string =>
`https://www.zigbee2mqtt.io/images/devices/${sanitizeZ2MDeviceName(device?.definition?.model)}.jpg`;
const getConverterDeviceImage = (device: Device): string | undefined => device.definition?.icon;

/* prettier-ignore */
const AVAILABLE_GENERATORS: ImageGeneratorFn[] = [
getConverterDeviceImage,
getZ2mDeviceImage,
Expand Down
14 changes: 9 additions & 5 deletions src/components/device-page/bind-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,17 @@ export class BindRow extends Component<BindRowProps, BindRowState> {

const possibleClusters: Set<Cluster> = new Set(stateRule.clusters);
const srcEndpoint = device.endpoints[stateRule.source.endpoint];
const dstEndpoint = (stateRule.target.type === 'endpoint' && stateRule.target.endpoint) ?
(target as Device)?.endpoints[stateRule.target.endpoint] : undefined;
const allClustersValid = stateRule.target.type === 'group' || (target as Device)?.type == "Coordinator";
const dstEndpoint =
stateRule.target.type === 'endpoint' && stateRule.target.endpoint
? (target as Device)?.endpoints[stateRule.target.endpoint]
: undefined;
const allClustersValid = stateRule.target.type === 'group' || (target as Device)?.type == 'Coordinator';
if (srcEndpoint && (dstEndpoint || allClustersValid)) {
for (const cluster of [...srcEndpoint.clusters.input, ...srcEndpoint.clusters.output]) {
const supportedInputOutput = srcEndpoint.clusters.input.includes(cluster) && dstEndpoint?.clusters.output.includes(cluster);
const supportedOutputInput = srcEndpoint.clusters.output.includes(cluster) && dstEndpoint?.clusters.input.includes(cluster);
const supportedInputOutput =
srcEndpoint.clusters.input.includes(cluster) && dstEndpoint?.clusters.output.includes(cluster);
const supportedOutputInput =
srcEndpoint.clusters.output.includes(cluster) && dstEndpoint?.clusters.input.includes(cluster);
if (supportedInputOutput || supportedOutputInput || allClustersValid) {
possibleClusters.add(cluster);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/features/composite/FeatureWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const FeatureWrapper: FunctionComponent<PropsWithChildren<FeatureWrapperP
const isColor = isColorFeature(feature);
const isReadable = (feature.property && feature.access & FeatureAccessMode.ACCESS_READ) || isColor;

const parentFeature = props.parentFeatures?.[props.parentFeatures.length - 1]
const parentFeature = props.parentFeatures?.[props.parentFeatures.length - 1];
let label = feature.label;
if (parentFeature?.label && feature.name === 'state' && !['light', 'switch'].includes(parentFeature.type)) {
label = `${parentFeature.label} ${feature.label.charAt(0).toLowerCase()}${feature.label.slice(1)}`;
Expand Down
4 changes: 2 additions & 2 deletions src/i18n/LocalePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const localesMap = {
ptbr,
es,
ua,
"zh-CN": chs,
'zh-CN': chs,
nl,
it,
zh,
Expand All @@ -49,7 +49,7 @@ const localesMap = {
sv,
tr,
no,
da,
da,
bg,
};

Expand Down
2 changes: 1 addition & 1 deletion ws.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function startServer() {
wss.on('connection', (ws) => {
const messages = JSON.parse(fs.readFileSync('./ws-messages/onConnect.json'));

messages.forEach(message => {
messages.forEach((message) => {
ws.send(JSON.stringify(message));
});

Expand Down

0 comments on commit a49f3c8

Please sign in to comment.