Skip to content

Commit

Permalink
assign exit delay to door sensors by default
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsfaber committed Aug 3, 2023
1 parent fe99817 commit cf216c7
Showing 1 changed file with 53 additions and 53 deletions.
106 changes: 53 additions & 53 deletions custom_components/alarmo/frontend/src/data/sensors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export const sensorConfigByType = (modeList: EArmModes[]): Dictionary<Partial<Al
allow_open: false,
arm_on_close: false,
use_entry_delay: true,
use_exit_delay: false,
use_exit_delay: true,
},
[ESensorTypes.Window]: {
modes: filterModes([EArmModes.ArmedAway, EArmModes.ArmedHome, EArmModes.ArmedNight, EArmModes.ArmedVacation]),
Expand Down Expand Up @@ -192,58 +192,58 @@ export const getConfigurableSensors = (
};

export const binarySensorIcon = (stateObj: HassEntity, state?: string) => {
const is_off = state === "off";
const is_off = state === 'off';
switch (stateObj?.attributes.device_class) {
case "battery":
return is_off ? "mdi:battery" : "mdi:battery-outline";
case "battery_charging":
return is_off ? "mdi:battery" : "mdi:battery-charging";
case "cold":
return is_off ? "mdi:thermometer" : "mdi:snowflake";
case "connectivity":
return is_off ? "mdi:server-network-off" : "mdi:server-network";
case "door":
return is_off ? "mdi:door-closed" : "mdi:door-open";
case "garage_door":
return is_off ? "mdi:garage" : "mdi:garage-open";
case "power":
return is_off ? "mdi:power-plug-off" : "mdi:power-plug";
case "gas":
case "problem":
case "safety":
case "tamper":
return is_off ? "mdi:check-circle" : "mdi:alert-circle";
case "smoke":
return is_off ? "mdi:check-circle" : "mdi:smoke";
case "heat":
return is_off ? "mdi:thermometer" : "mdi:fire";
case "light":
return is_off ? "mdi:brightness-5" : "mdi:brightness-7";
case "lock":
return is_off ? "mdi:lock" : "mdi:lock-open";
case "moisture":
return is_off ? "mdi:water-off" : "mdi:water";
case "motion":
return is_off ? "mdi:walk" : "mdi:run";
case "occupancy":
return is_off ? "mdi:home-outline" : "mdi:home";
case "opening":
return is_off ? "mdi:square" : "mdi:square-outline";
case "plug":
return is_off ? "mdi:power-plug-off" : "mdi:power-plug";
case "presence":
return is_off ? "mdi:home-outline" : "mdi:home";
case "running":
return is_off ? "mdi:stop" : "mdi:play";
case "sound":
return is_off ? "mdi:music-note-off" : "mdi:music-note";
case "update":
return is_off ? "mdi:package" : "mdi:package-up";
case "vibration":
return is_off ? "mdi:crop-portrait" : "mdi:vibrate";
case "window":
return is_off ? "mdi:window-closed" : "mdi:window-open";
case 'battery':
return is_off ? 'mdi:battery' : 'mdi:battery-outline';
case 'battery_charging':
return is_off ? 'mdi:battery' : 'mdi:battery-charging';
case 'cold':
return is_off ? 'mdi:thermometer' : 'mdi:snowflake';
case 'connectivity':
return is_off ? 'mdi:server-network-off' : 'mdi:server-network';
case 'door':
return is_off ? 'mdi:door-closed' : 'mdi:door-open';
case 'garage_door':
return is_off ? 'mdi:garage' : 'mdi:garage-open';
case 'power':
return is_off ? 'mdi:power-plug-off' : 'mdi:power-plug';
case 'gas':
case 'problem':
case 'safety':
case 'tamper':
return is_off ? 'mdi:check-circle' : 'mdi:alert-circle';
case 'smoke':
return is_off ? 'mdi:check-circle' : 'mdi:smoke';
case 'heat':
return is_off ? 'mdi:thermometer' : 'mdi:fire';
case 'light':
return is_off ? 'mdi:brightness-5' : 'mdi:brightness-7';
case 'lock':
return is_off ? 'mdi:lock' : 'mdi:lock-open';
case 'moisture':
return is_off ? 'mdi:water-off' : 'mdi:water';
case 'motion':
return is_off ? 'mdi:walk' : 'mdi:run';
case 'occupancy':
return is_off ? 'mdi:home-outline' : 'mdi:home';
case 'opening':
return is_off ? 'mdi:square' : 'mdi:square-outline';
case 'plug':
return is_off ? 'mdi:power-plug-off' : 'mdi:power-plug';
case 'presence':
return is_off ? 'mdi:home-outline' : 'mdi:home';
case 'running':
return is_off ? 'mdi:stop' : 'mdi:play';
case 'sound':
return is_off ? 'mdi:music-note-off' : 'mdi:music-note';
case 'update':
return is_off ? 'mdi:package' : 'mdi:package-up';
case 'vibration':
return is_off ? 'mdi:crop-portrait' : 'mdi:vibrate';
case 'window':
return is_off ? 'mdi:window-closed' : 'mdi:window-open';
default:
return is_off ? "mdi:radiobox-blank" : "mdi:checkbox-marked-circle";
return is_off ? 'mdi:radiobox-blank' : 'mdi:checkbox-marked-circle';
}
};
};

0 comments on commit cf216c7

Please sign in to comment.