Skip to content

Commit

Permalink
Fix device multiplication #13
Browse files Browse the repository at this point in the history
  • Loading branch information
Drakulix committed Nov 17, 2020
1 parent 28045f0 commit 9dc83ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion custom_components/googlehome/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ async def async_step_init(self, user_input=None):
{
vol.Required(CONF_TRACK_ALARMS, default=self.config_entry.options.get(CONF_TRACK_ALARMS, False)): bool,
vol.Required(CONF_TRACK_DEVICES, default=self.config_entry.options.get(CONF_TRACK_DEVICES, True)): bool,
vol.Required(CONF_TRACK_NEW_DEVICES, default=self.config_entry.options.get(CONF_TRACK_NEW_DEVICES, DEFAULT_TRACK_NEW)): bool,
#vol.Required(CONF_TRACK_NEW_DEVICES, default=self.config_entry.options.get(CONF_TRACK_NEW_DEVICES, DEFAULT_TRACK_NEW)): bool,
vol.Required(CONF_CONSIDER_HOME, default=self.config_entry.options.get(CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds())): int,
vol.Required(
CONF_RSSI_THRESHOLD,
Expand Down
6 changes: 5 additions & 1 deletion custom_components/googlehome/device_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ def __init__(self, hass, client, config, device):
super().__init__(
hass,
timedelta(seconds=config.options.get(CONF_CONSIDER_HOME, DEFAULT_CONSIDER_HOME.total_seconds())),
config.options.get(CONF_TRACK_NEW_DEVICES, DEFAULT_TRACK_NEW),
#config.options.get(CONF_TRACK_NEW_DEVICES, DEFAULT_TRACK_NEW),
True, # TODO migrate to the new device tracker api
{}, list(),
)
self.hass = hass
Expand Down Expand Up @@ -136,3 +137,6 @@ async def async_update(self, now=None):
attributes["rssi"] = device["rssi"]

await self.async_see(mac=device["mac_address"], host_name=device.get("name"), source_type=SOURCE_TYPE_BLUETOOTH, attributes=attributes)

async def async_update_config(self, path, dev_id, device):
pass

0 comments on commit 9dc83ba

Please sign in to comment.