Skip to content

Commit

Permalink
Fixed crash when eweLink user changed password
Browse files Browse the repository at this point in the history
  • Loading branch information
guyluz11 committed Oct 7, 2023
1 parent 2464cc5 commit 4c62a85
Show file tree
Hide file tree
Showing 39 changed files with 165 additions and 207 deletions.
2 changes: 1 addition & 1 deletion bin/cbj_hub.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Future<void> main(List<String> arguments) async {

await getIt<ILocalDbRepository>().initializeDb();

logger.v('');
logger.t('');

await BootUp.setup();
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class GenericDimmableLightSwitchState extends ValueObjectCore<String> {
class GenericDimmableLightBrightness extends ValueObjectCore<String> {
factory GenericDimmableLightBrightness(String? input) {
assert(input != null);
String tempInput = input!;
final String tempInput = input!;

return GenericDimmableLightBrightness._(
validateGenericDimmableLightNotEmpty(tempInput),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class AppCommunicationRepository extends IAppCommunicationRepository {
late int hubPort;

Future startLocalServer() async {
final server = Server([HubAppServer()]);
final server = Server.create(services: [HubAppServer()]);
await server.serve(port: hubPort);
logger.i('Hub Server listening for apps clients on port ${server.port}...');
}
Expand Down Expand Up @@ -217,7 +217,7 @@ class AppCommunicationRepository extends IAppCommunicationRepository {
}
}).onError((error) {
if (error is GrpcError && error.code == 1) {
logger.v('Client have disconnected');
logger.t('Client have disconnected');
} else if (error is GrpcError && error.code == 14) {
final String errorMessage = error.message!;

Expand Down
2 changes: 1 addition & 1 deletion lib/infrastructure/app_communication/hub_app_server.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class HubAppServer extends CbjHubServiceBase {
Stream<ClientStatusRequests> request,
) async* {
try {
logger.v('Got new Client');
logger.t('Got new Client');

getIt<IAppCommunicationRepository>().getFromApp(
request: request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class CbjDevicesConnectorConjector

companyDevices.addEntries([deviceAsEntry]);

logger.v(
logger.t(
'New Cbj Smart Device name:${entityAsDevice.cbjEntityName.getOrCrash()}',
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class CbjDevicesApiObject {
if (sDeviceType == CbjDevicesDevicesTypes.cbjDevicesRunner ||
sDeviceType == CbjDevicesDevicesTypes.cbjDevicesRunnerMini) {
if (!isCbjDevicesMessageNew(data, hexSeparatedLetters)) {
logger.v('Not new cbjDevices device!');
logger.t('Not new cbjDevices device!');
}

final CbjDevicesDeviceDirection cbjDevicesDeviceDirection =
Expand All @@ -79,7 +79,7 @@ class CbjDevicesApiObject {
}

if (!isCbjDevicesMessage(data, hexSeparatedLetters)) {
logger.v('Not old cbjDevices device!');
logger.t('Not old cbjDevices device!');
}

final CbjDevicesDeviceState cbjDevicesDeviceState =
Expand Down Expand Up @@ -216,7 +216,7 @@ class CbjDevicesApiObject {
Future<void> stopBlinds() async {
if (deviceType != CbjDevicesDevicesTypes.cbjDevicesRunner &&
deviceType != CbjDevicesDevicesTypes.cbjDevicesRunnerMini) {
logger.v('Stop blinds support only for blinds');
logger.t('Stop blinds support only for blinds');
return;
}

Expand All @@ -242,7 +242,7 @@ class CbjDevicesApiObject {
Future<void> setPosition({int pos = 0}) async {
if (deviceType != CbjDevicesDevicesTypes.cbjDevicesRunner &&
deviceType != CbjDevicesDevicesTypes.cbjDevicesRunnerMini) {
logger.v('Set position support only blinds');
logger.t('Set position support only blinds');
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ class CompaniesConnectorConjector {
port: mdnsPort,
);
} else {
logger.v(
logger.t(
'mDNS service type ${hostMdnsInfo.mdnsServiceType} is not supported\n IP: ${activeHost.address}, Port: ${hostMdnsInfo.mdnsPort}, ServiceType: ${hostMdnsInfo.mdnsServiceType}, MdnsName: ${hostMdnsInfo.getOnlyTheStartOfMdnsName()}',
);
}
Expand Down
Loading

0 comments on commit 4c62a85

Please sign in to comment.