Skip to content

Commit 87795b2

Browse files
aastefanovwww-data
authored andcommitted
Sensor patches
- show the non-test sensor values - fix the URL for the Prometheus history - not all devices actually report whether they're available
1 parent 434c607 commit 87795b2

3 files changed

Lines changed: 8 additions & 8 deletions

File tree

src/config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ export const oidc = {
1313

1414
export type MqttConfig = {[topic: string]: {label: string}}
1515
export const sensors: MqttConfig = {
16-
'sensors/big-room/test': {label: 'big-room'},
17-
'sensors/small-room/test': {label: 'small-room',},
18-
'sensors/kitchen/test': {label: 'kitchen',},
19-
'sensors/outside/test': {label: 'outside',},
16+
'sensors/big-room': {label: 'big-room'},
17+
'sensors/small-room': {label: 'small-room',},
18+
'sensors/kitchen': {label: 'kitchen',},
19+
'sensors/outside': {label: 'outside',},
2020
};
2121

2222
export const variantHosts: {[hostname: string]: string} = {
@@ -41,8 +41,8 @@ export const variants: {[variant: string]: VariantConfig} = {
4141
},
4242
'colibri': {
4343
dashboard: ColibriDashboard,
44-
navbar: {bg: 'light',},
44+
navbar: {bg: 'body-tertiary',},
4545
logo: {url: colibriLogo, alt: 'colibri logo',},
4646
title: 'Casa Libri',
4747
},
48-
}
48+
}

src/hooks/useEndpoints.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export function useMqttStatus(config?: SWRConfiguration) {
3636
export function useMqttHistory(config?: SWRConfiguration) {
3737
return useCheckSWR<{
3838
[sensor: string]: MqttSensorHistory
39-
}>(import.meta.env.MQTT_PROXY_URL.concat('sensors/'), config);
39+
}>(import.meta.env.MQTT_PROXY_URL.concat('sensors'), config);
4040
}
4141

4242
export function useActionLog(config?: SWRConfiguration) {

src/pages/Devices.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Devices = ({
3636
{devices && <>
3737
{filteredDevices.length > 0 ? filteredDevices.map(device => {
3838
const deviceActions = deviceActionMapper(device);
39-
const isUnavailable = !device?.statuses?.available;
39+
const isUnavailable = device?.statuses?.available === false;
4040
const isOpen = !!device?.statuses?.open;
4141

4242
return (<Col key={device.id} className={`col-xl-${2 * deviceActions.length}`}>

0 commit comments

Comments
 (0)