Skip to content

Commit

Permalink
Remove unused functionality old integrations
Browse files Browse the repository at this point in the history
  • Loading branch information
guyluz11 committed Jan 21, 2024
1 parent ee13ab7 commit bd9777b
Show file tree
Hide file tree
Showing 11 changed files with 199 additions and 506 deletions.
1 change: 0 additions & 1 deletion bin/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import 'dart:io';

import 'package:cbj_integrations_controller/integrations_controller.dart';
import 'package:cbj_smart_device/application/usecases/core_u/smart_device_manager_u.dart';
import 'package:cbj_smart_device/infrastructure/datasources/core_d/manage_physical_components/device_pin_manager.dart';
import 'package:cbj_smart_device/utils.dart';

void main(List<String> arguments) async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:cbj_smart_device/application/usecases/button_object_u/simple_but
import 'package:cbj_smart_device/application/usecases/devices_pin_configuration_u/pin_information.dart';
import 'package:cbj_smart_device/application/usecases/wish_classes_u/off_wish_u.dart';
import 'package:cbj_smart_device/application/usecases/wish_classes_u/on_wish_u.dart';
import 'package:cbj_smart_device/infrastructure/datasources/core_d/manage_physical_components/device_pin_manager.dart';
import 'package:cbj_smart_device/infrastructure/repositories/button_object_r/button_object_r.dart';
import 'package:cbj_smart_device/utils.dart';

Expand All @@ -12,11 +11,12 @@ class ButtonWithLightObject extends ButtonObject {
ButtonWithLightObject(
super.id,
super.deviceName,
super.buttonPinInt,
int? buttonLightInt, {
// super.buttonPinInt,
// int? buttonLightInt,
{
super.buttonStatesAction,
}) {
buttonLight = DevicePinListManager().getGpioPin(buttonLightInt);
// buttonLight = DevicePinListManager().getGpioPin(buttonLightInt);

buttonObjectRepository = ButtonObjectR();
listenToButtonPress();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:cbj_smart_device/application/usecases/devices_pin_configuration_
import 'package:cbj_smart_device/application/usecases/smart_device_objects_u/abstracts_devices/smart_device_base.dart';
import 'package:cbj_smart_device/application/usecases/smart_device_objects_u/abstracts_devices/smart_device_base_abstract.dart';
import 'package:cbj_smart_device/core/my_singleton.dart';
import 'package:cbj_smart_device/infrastructure/datasources/core_d/manage_physical_components/device_pin_manager.dart';
import 'package:cbj_smart_device/infrastructure/repositories/button_object_r/button_object_r.dart';
import 'package:cbj_smart_device/utils.dart';

Expand All @@ -12,10 +11,11 @@ class ButtonObject extends SmartDeviceBaseAbstract {
ButtonObject(
super.id,
super.deviceName,
int? buttonPinInt, {
// int? buttonPinInt,
{
this.buttonStatesAction,
}) {
buttonPin = DevicePinListManager().getGpioPin(buttonPinInt);
// buttonPin = DevicePinListManager().getGpioPin(buttonPinInt);

buttonObjectRepository = ButtonObjectR();
listenToButtonPress();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import 'package:cbj_smart_device/application/usecases/wish_classes_u/on_wish_u.d
import 'package:cbj_smart_device/application/usecases/wish_classes_u/smart_computer_wish_u.dart';
import 'package:cbj_smart_device/core/helper_methods.dart';
import 'package:cbj_smart_device/domain/entities/core_e/enums_e.dart';
import 'package:cbj_smart_device/infrastructure/datasources/core_d/manage_physical_components/device_pin_manager.dart';
import 'package:cbj_smart_device/infrastructure/repositories/smart_device_objects_r/smart_device_objects_r.dart';
import 'package:cbj_smart_device/utils.dart';

Expand Down Expand Up @@ -124,10 +123,11 @@ abstract class SmartDeviceBase extends SmartDeviceBaseAbstract {
PinInformation? addPinToGpioPinList(int pinNumber) {
// Check if pin is free to be taken,
// if not return negative number with error number
final PinInformation gpioPin =
DevicePinListManager().getGpioPin(pinNumber)!;
_gpioPinList.add(gpioPin);
return gpioPin;
// final PinInformation gpioPin =
// DevicePinListManager().getGpioPin(pinNumber)!;
// _gpioPinList.add(gpioPin);
// return gpioPin;
return null;
}

/// Return PossibleWishes object if
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ import 'package:cbj_smart_device/application/usecases/devices_pin_configuration_
import 'package:cbj_smart_device/application/usecases/smart_device_objects_u/abstracts_devices/smart_device_simple_abstract.dart';
import 'package:cbj_smart_device/application/usecases/wish_classes_u/off_wish_u.dart';
import 'package:cbj_smart_device/application/usecases/wish_classes_u/on_wish_u.dart';
import 'package:cbj_smart_device/infrastructure/datasources/core_d/manage_physical_components/device_pin_manager.dart';
import 'package:cbj_smart_device/utils.dart';

class BoilerObject extends SmartDeviceSimpleAbstract {
BoilerObject(
String? uuid,
String? smartInstanceName,
int? boilerPinNUmber,
int? boilerButtonPinNumber, {
// int? boilerPinNUmber,
// int? boilerButtonPinNumber,
{
int? onOffPinNumber,
int? onOffButtonPinNumber,
}) : super(
Expand All @@ -22,8 +22,8 @@ class BoilerObject extends SmartDeviceSimpleAbstract {
onOffButtonPinNumber: onOffButtonPinNumber,
) {
logger.i('New boiler object');
boilerPin = DevicePinListManager().getGpioPin(boilerPinNUmber);
boilerButtonPin = DevicePinListManager().getGpioPin(boilerButtonPinNumber);
// boilerPin = DevicePinListManager().getGpioPin(boilerPinNUmber);
// boilerButtonPin = DevicePinListManager().getGpioPin(boilerButtonPinNumber);
listenButtonsPress();
deviceType = CbjDeviceTypes.boiler;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import 'package:cbj_smart_device/application/usecases/button_object_u/button_obj
import 'package:cbj_smart_device/application/usecases/devices_pin_configuration_u/pin_information.dart';
import 'package:cbj_smart_device/application/usecases/smart_device_objects_u/abstracts_devices/smart_device_static_abstract.dart';
import 'package:cbj_smart_device/application/usecases/wish_classes_u/blinds_wish_u.dart';
import 'package:cbj_smart_device/infrastructure/datasources/core_d/manage_physical_components/device_pin_manager.dart';
import 'package:cbj_smart_device/utils.dart';

/// Object to control blinds
Expand All @@ -14,18 +13,18 @@ class BlindsObject extends SmartDeviceStaticAbstract {
String? super.smartInstanceName,
super.onOffPinNumber,
onOffButtonPinNumber,
int? blindsUpPin,
int? upButtonPinNumber,
int? blindsDownPin,
int? downButtonPinNumber,
// int? blindsUpPin,
// int? upButtonPinNumber,
// int? blindsDownPin,
// int? downButtonPinNumber,
) : super(
onOffButtonPinNumber: onOffButtonPinNumber,
) {
buttonPinUp = DevicePinListManager().getGpioPin(upButtonPinNumber);
buttonPinDown = DevicePinListManager().getGpioPin(downButtonPinNumber);
// buttonPinUp = DevicePinListManager().getGpioPin(upButtonPinNumber);
// buttonPinDown = DevicePinListManager().getGpioPin(downButtonPinNumber);

this.blindsUpPin = DevicePinListManager().getGpioPin(blindsUpPin);
this.blindsDownPin = DevicePinListManager().getGpioPin(blindsDownPin);
// this.blindsUpPin = DevicePinListManager().getGpioPin(blindsUpPin);
// this.blindsDownPin = DevicePinListManager().getGpioPin(blindsDownPin);
listenToTwoButtonsPress();

deviceType = CbjDeviceTypes.blinds;
Expand Down
11 changes: 7 additions & 4 deletions lib/domain/entities/core_e/enums_e.dart
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,16 @@ class EnumHelper {
case CbjDeviceTypes.light:
return LightObject(null, null, null);
case CbjDeviceTypes.blinds:
return BlindsObject(null, null, null, null, null, null, null, null);
return BlindsObject(null, null, null, null);
case CbjDeviceTypes.boiler:
return BoilerObject(null, null, null, null);
return BoilerObject(null, null);
case CbjDeviceTypes.button:
return ButtonObject(null, null, null);
return ButtonObject(null, null);
case CbjDeviceTypes.buttonWithLight:
return ButtonWithLightObject(null, null, null, null);
return ButtonWithLightObject(
null,
null,
);
default:
logger.i('Type $deviceType is not supported');
}
Expand Down
Loading

0 comments on commit bd9777b

Please sign in to comment.