mirror of
https://github.com/tsightler/ring-mqtt.git
synced 2025-09-26 21:01:12 +08:00
Update entity categories
This commit is contained in:
@@ -36,6 +36,7 @@ export default class RingSocketDevice extends RingDevice {
|
||||
...this.entity,
|
||||
info: {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
...primaryAttribute
|
||||
? { value_template: `{{ value_json["${primaryAttribute}"] | default("") }}` }
|
||||
: { value_template: '{{ value_json["commStatus"] | default("") }}' }
|
||||
@@ -43,6 +44,7 @@ export default class RingSocketDevice extends RingDevice {
|
||||
...this.device.data.hasOwnProperty('batteryLevel') ? {
|
||||
battery: {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
device_class: 'battery',
|
||||
unit_of_measurement: '%',
|
||||
state_class: 'measurement',
|
||||
@@ -63,6 +65,7 @@ export default class RingSocketDevice extends RingDevice {
|
||||
&& this.device.data.hasOwnProperty('networks') && this.device.data.networks.hasOwnProperty('wlan0') ? {
|
||||
wireless: {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
device_class: 'signal_strength',
|
||||
unit_of_measurement: 'dBm',
|
||||
parent_state_topic: 'info/state',
|
||||
|
@@ -20,6 +20,7 @@ export default class BaseStation extends RingSocketDevice {
|
||||
this.device.setVolume(origVolume)
|
||||
this.entity.volume = {
|
||||
component: 'number',
|
||||
category: 'config',
|
||||
min: 0,
|
||||
max: 100,
|
||||
mode: 'slider',
|
||||
|
@@ -122,7 +122,7 @@ export default class Camera extends RingPolledDevice {
|
||||
},
|
||||
stream: {
|
||||
component: 'switch',
|
||||
category: 'config',
|
||||
category: 'diagnostic',
|
||||
attributes: true,
|
||||
name: 'Live Stream',
|
||||
icon: 'mdi:cctv',
|
||||
@@ -131,7 +131,7 @@ export default class Camera extends RingPolledDevice {
|
||||
},
|
||||
event_stream: {
|
||||
component: 'switch',
|
||||
category: 'config',
|
||||
category: 'diagnostic',
|
||||
attributes: true,
|
||||
icon: 'mdi:vhs',
|
||||
// Use internal MQTT server for inter-process communications
|
||||
@@ -175,7 +175,6 @@ export default class Camera extends RingPolledDevice {
|
||||
...this.device.hasSiren ? {
|
||||
siren: {
|
||||
component: 'switch',
|
||||
category: 'config',
|
||||
icon: 'mdi:alarm-light'
|
||||
}
|
||||
} : {},
|
||||
@@ -310,6 +309,7 @@ export default class Camera extends RingPolledDevice {
|
||||
if (deviceHealth && !(deviceHealth?.network_connection && deviceHealth.network_connection === 'ethernet')) {
|
||||
this.entity.wireless = {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
device_class: 'signal_strength',
|
||||
unit_of_measurement: 'dBm',
|
||||
parent_state_topic: 'info/state',
|
||||
@@ -322,6 +322,7 @@ export default class Camera extends RingPolledDevice {
|
||||
if (this.device.batteryLevel || this.hasBattery1 || this.hasBattery2) {
|
||||
this.entity.battery = {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
device_class: 'battery',
|
||||
unit_of_measurement: '%',
|
||||
state_class: 'measurement',
|
||||
|
@@ -48,12 +48,10 @@ export default class Chime extends RingPolledDevice {
|
||||
},
|
||||
play_ding_sound: {
|
||||
component: 'switch',
|
||||
category: 'config',
|
||||
icon: 'hass:bell-ring'
|
||||
},
|
||||
play_motion_sound: {
|
||||
component: 'switch',
|
||||
category: 'config',
|
||||
icon: 'hass:bell-ring'
|
||||
},
|
||||
...this.device.data.settings.night_light_settings?.hasOwnProperty('light_sensor_enabled') ? {
|
||||
@@ -85,6 +83,7 @@ export default class Chime extends RingPolledDevice {
|
||||
initAttributeEntities() {
|
||||
this.entity.wireless = {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
device_class: 'signal_strength',
|
||||
unit_of_measurement: 'dBm',
|
||||
parent_state_topic: 'info/state',
|
||||
|
@@ -50,6 +50,7 @@ export default class Lock extends RingPolledDevice {
|
||||
if (this.device.batteryLevel !== null) {
|
||||
this.entity.battery = {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
device_class: 'battery',
|
||||
unit_of_measurement: '%',
|
||||
state_class: 'measurement',
|
||||
@@ -62,6 +63,7 @@ export default class Lock extends RingPolledDevice {
|
||||
if (deviceHealth && !(deviceHealth?.network_connection && deviceHealth.network_connection === 'ethernet')) {
|
||||
this.entity.wireless = {
|
||||
component: 'sensor',
|
||||
category: 'diagnostic',
|
||||
device_class: 'signal_strength',
|
||||
unit_of_measurement: 'dBm',
|
||||
parent_state_topic: 'info/state',
|
||||
|
@@ -35,20 +35,17 @@ export default class SecurityPanel extends RingSocketDevice {
|
||||
},
|
||||
siren: {
|
||||
component: 'switch',
|
||||
category: 'diagnostic',
|
||||
icon: 'mdi:alarm-light',
|
||||
name: `Siren`
|
||||
},
|
||||
...utils.config().enable_panic ? {
|
||||
police: {
|
||||
component: 'switch',
|
||||
category: 'diagnostic',
|
||||
name: `Panic - Police`,
|
||||
icon: 'mdi:police-badge'
|
||||
},
|
||||
fire: {
|
||||
component: 'switch',
|
||||
category: 'diagnostic',
|
||||
name: `Panic - Fire`,
|
||||
icon: 'mdi:fire'
|
||||
}
|
||||
|
@@ -8,7 +8,6 @@ export default class Siren extends RingSocketDevice {
|
||||
...this.entity,
|
||||
siren: {
|
||||
component: 'switch',
|
||||
category: 'diagnostic',
|
||||
icon: 'mdi:alarm-light',
|
||||
isMainEntity: true
|
||||
},
|
||||
|
Reference in New Issue
Block a user