WIP #523 and connection settings refactoring

This commit is contained in:
Yegor Vialov
2020-05-02 23:02:18 +00:00
parent 96c8338890
commit 725ec9291d
11 changed files with 329 additions and 153 deletions

View File

@ -53,7 +53,10 @@ class ConnectionManager {
httpWebHost =
"${prefs.getString('hassio-res-protocol')}://$_domain:$_port";
Logger.d('$_domain$_port');
if ((_domain == null) || (_port == null) ||
if (_domain == null && _port == null && webhookId == null && mobileAppDeviceName == null) {
completer.completeError(HACNotSetUpException());
stopInit = true;
} else if ((_domain == null) || (_port == null) ||
(_domain.isEmpty) || (_port.isEmpty)) {
completer.completeError(HACException.checkConnectionSettings());
stopInit = true;

View File

@ -17,6 +17,9 @@ class MobileAppIntegrationManager {
};
static String getDefaultDeviceName() {
if (HomeAssistant().userName.isEmpty) {
return '${DeviceInfoManager().model}';
}
return '${HomeAssistant().userName}\'s ${DeviceInfoManager().model}';
}

View File

@ -19,7 +19,7 @@ class HAClientTheme {
fontWeight: FontWeight.normal,
letterSpacing: 1,
),
button: TextStyle(fontSize: 14, fontWeight: FontWeight.w500),
button: TextStyle(fontSize: 16, fontWeight: FontWeight.w500),
);
static const offEntityStates = [