Skip to content

Commit

Permalink
Give HomeKit locks better names by default (#22333)
Browse files Browse the repository at this point in the history
## Description:

This is a follow up to #22171. There we set the name of an entity based on the `accessory-information` homekit service, rather than using the zeroconf/avahi name metadata. Unfortunately Lock also sets its name from zeroconf directly, rather than picking it up from the base class. This test updates it to be like the other homekit entities and use the base class.

(This is from my ongoing homekit_controller configentry branch).

## Checklist:
  - [x] The code change is tested and works locally.
  - [x] Local tests pass with `tox`. **Your PR cannot be merged unless tests pass**
  - [x] There is no commented out code in this PR.
  • Loading branch information
Jc2k authored and robbiet480 committed Mar 25, 2019
1 parent 324a7c7 commit af4b85d
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions homeassistant/components/homekit_controller/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ def __init__(self, accessory, discovery_info):
"""Initialise the Lock."""
super().__init__(accessory, discovery_info)
self._state = None
self._name = discovery_info['model']
self._battery_level = None

def get_characteristic_types(self):
Expand All @@ -60,11 +59,6 @@ def _update_lock_mechanism_current_state(self, value):
def _update_battery_level(self, value):
self._battery_level = value

@property
def name(self):
"""Return the name of this device."""
return self._name

@property
def is_locked(self):
"""Return true if device is locked."""
Expand Down

0 comments on commit af4b85d

Please sign in to comment.