/* Copyright (C) 2024 Andreas Shimokawa This file is part of Gadgetbridge. Gadgetbridge is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Gadgetbridge is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ package nodomain.freeyourgadget.gadgetbridge.devices.marstek; import android.app.Activity; import androidx.annotation.NonNull; import java.util.regex.Pattern; import nodomain.freeyourgadget.gadgetbridge.GBException; import nodomain.freeyourgadget.gadgetbridge.R; import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession; import nodomain.freeyourgadget.gadgetbridge.entities.Device; import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice; import nodomain.freeyourgadget.gadgetbridge.service.DeviceSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.marstek.MarstekB2500DeviceSupport; public class MarstekB2500DeviceCoordinator extends AbstractDeviceCoordinator { @Override public int getDeviceNameResource() { return R.string.devicetype_marstek_b2500; } @Override public int getDefaultIconResource() { return R.drawable.ic_device_vesc; } @Override public int getDisabledIconResource() { return R.drawable.ic_device_vesc_disabled; } @Override public String getManufacturer() { return "Marstek"; } @NonNull @Override public Class getDeviceSupportClass() { return MarstekB2500DeviceSupport.class; } @Override protected Pattern getSupportedDeviceName() { return Pattern.compile("HM_B2500_.*"); } @Override protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device device, @NonNull DaoSession session) throws GBException { } @Override public boolean supportsAppsManagement(final GBDevice device) { return true; } @Override public Class getAppsManagementActivity() { return SolarEquipmentStatusActivity.class; } @Override public int getBondingStyle() { return BONDING_STYLE_NONE; } @Override public int[] getSupportedDeviceSpecificSettings(GBDevice device) { return new int[]{ R.xml.devicesettings_battery_allow_pass_through, R.xml.devicesettings_battery_minimum_charge, R.xml.devicesettings_battery_discharge_5 }; } @Override public boolean isExperimental() { return true; } }