Skip to content

Commit

Permalink
cyberos.network: Hostname limit is 15 chars.
Browse files Browse the repository at this point in the history
  • Loading branch information
inovatorius committed Sep 4, 2023
1 parent 302428d commit 5cda333
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions network.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def __init__(self):
asyncio.create_task(_ap_color_code_update())

if self._sta_hostname is None:
self.sta_hostname = cyberos.cyberware.name
self.sta_hostname = '' # Reset the hostname to default value.

if self._sta_boot:
self._on_sta_up.set()
Expand Down Expand Up @@ -141,7 +141,7 @@ def sta_hostname(self):

@sta_hostname.setter
def sta_hostname(self, value):
self._sta_hostname = '%s-%s' % (cyberos.cyberware.name, self._ap_color_code) if not len(value) else value
self._sta_hostname = '%s-%s' % ('FCW', cyberos.cyberware.id.decode()) if not len(value) else value
cyberos.preferences['sta_hostname'] = self._sta_hostname
cyberos.settings.on_save_settings.set()

Expand Down Expand Up @@ -305,13 +305,13 @@ async def connect(self, ssid=None, key=None):
_wlan_status = self._sta_if.status()
while not self._sta_if.isconnected():
_wlan_status = self._sta_if.status()
if _wlan_status == 2:
if _wlan_status == network.STAT_WRONG_PASSWORD:
print('CYBEROS > WRONG PASSWORD FOR {} AP'.format(ssid))
return
if _wlan_status == 3:
if _wlan_status == network.STAT_NO_AP_FOUND:
print('CYBEROS > {} AP NOT FOUND'.format(ssid))
return
if _wlan_status == 4:
if _wlan_status == network.STAT_CONNECT_FAIL:
print('CYBEROS > CONNECTION TO {} AP FAILED'.format(ssid))
return
await asyncio.sleep(0)
Expand Down

0 comments on commit 5cda333

Please sign in to comment.