diff --git a/freebox.py b/freebox.py index fea3795..7b85c84 100644 --- a/freebox.py +++ b/freebox.py @@ -161,7 +161,7 @@ def authorize(): except requests.exceptions.SSLError: print("KO for", root_ca) - if self.root_ca is '': + if self.root_ca == '': print('Warning: using unsecure communication!') self.protocol = 'http' # re-compute URI using http diff --git a/main.py b/main.py index e523fda..214ea98 100755 --- a/main.py +++ b/main.py @@ -260,8 +260,9 @@ def print_config(): print('graph_args --lower-limit 0') stations = get_wifi_stations() for station in stations: - print('{}.label {}'.format(station, station)) - print('{}.draw AREASTACK'.format(station)) + station_safe = station.replace(" ", "_") + print('{}.label {}'.format(station_safe, station)) + print('{}.draw AREASTACK'.format(station_safe)) elif mode == mode_wifi_bytes: print('graph_title Wifi bytes up/down') print('graph_scale yes') @@ -411,7 +412,8 @@ def query_wifi_stations(): value = 1 else: value = 0 - print('{}.value {}'.format(station, value)) + station_safe = station.replace(" ", "_") + print('{}.value {}'.format(station_safe, value)) def query_wifi_bytes(): data = freebox.api('wifi/ap/0/stations/') @@ -498,7 +500,8 @@ def query_switch_stations(interface): value = 1 else: value = 0 - print('{}.value {}'.format(station, value)) + station_safe = station.replace(" ", "_") + print('{}.value {}'.format(station_safe, value)) def query_rrd_data():