Removed manual accounting enable/disable checkbox, now it dinamically creates entites depending on state in Mikrotik. Reverted config flow to version 1.

Reused ARP call in accounting hosts building.
This commit is contained in:
Ivan Pavlina 2020-04-07 14:50:26 +02:00
parent 39c31cb84a
commit 069897c32c
8 changed files with 50 additions and 70 deletions

View file

@ -17,7 +17,6 @@ from .const import (
DOMAIN,
DATA_CLIENT,
DEFAULT_TRAFFIC_TYPE,
CONF_TRACK_ACCOUNTING,
)
from .mikrotik_controller import MikrotikControllerData
@ -49,11 +48,10 @@ async def async_setup_entry(hass, config_entry):
traffic_type = config_entry.data[CONF_UNIT_OF_MEASUREMENT]
else:
traffic_type = DEFAULT_TRAFFIC_TYPE
track_accounting = config_entry.data[CONF_TRACK_ACCOUNTING]
mikrotik_controller = MikrotikControllerData(
hass, config_entry, name, host, port, username, password, use_ssl,
traffic_type, track_accounting
traffic_type
)
await mikrotik_controller.hwinfo_update()