Give HomeKit locks better names by default (#22333)

## 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.
pull/19590/head
Jc2k 2019-03-25 01:21:04 +00:00 committed by Robbie Trencheny
parent 324a7c7875
commit af4b85d39d
1 changed files with 0 additions and 6 deletions

View File

@ -41,7 +41,6 @@ class HomeKitLock(HomeKitEntity, LockDevice):
"""Initialise the Lock.""" """Initialise the Lock."""
super().__init__(accessory, discovery_info) super().__init__(accessory, discovery_info)
self._state = None self._state = None
self._name = discovery_info['model']
self._battery_level = None self._battery_level = None
def get_characteristic_types(self): def get_characteristic_types(self):
@ -60,11 +59,6 @@ class HomeKitLock(HomeKitEntity, LockDevice):
def _update_battery_level(self, value): def _update_battery_level(self, value):
self._battery_level = value self._battery_level = value
@property
def name(self):
"""Return the name of this device."""
return self._name
@property @property
def is_locked(self): def is_locked(self):
"""Return true if device is locked.""" """Return true if device is locked."""