mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
handle missing friendly name
This commit is contained in:
@@ -97,7 +97,11 @@ function HomeAssistantAccessory(log, data, client) {
|
||||
// device info
|
||||
this.data = data
|
||||
this.entity_id = data.entity_id
|
||||
if (data.attributes && data.attributes.friendly_name) {
|
||||
this.name = data.attributes.friendly_name
|
||||
}else{
|
||||
this.name = data.entity_id.split('.').pop().replace(/_/g, ' ')
|
||||
}
|
||||
|
||||
this.client = client
|
||||
this.log = log;
|
||||
|
||||
Reference in New Issue
Block a user