Fix ConfigConstants deprecations (#8525)
Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
@@ -33,7 +33,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.miio.internal.MiIoBindingConstants;
|
||||
import org.openhab.binding.miio.internal.Utils;
|
||||
import org.openhab.core.config.core.ConfigConstants;
|
||||
import org.openhab.core.OpenHAB;
|
||||
import org.openhab.core.service.AbstractWatchService;
|
||||
import org.osgi.framework.Bundle;
|
||||
import org.osgi.framework.FrameworkUtil;
|
||||
@@ -56,7 +56,7 @@ import com.google.gson.JsonSyntaxException;
|
||||
@Component(service = MiIoDatabaseWatchService.class)
|
||||
@NonNullByDefault
|
||||
public class MiIoDatabaseWatchService extends AbstractWatchService {
|
||||
private static final String LOCAL_DATABASE_PATH = ConfigConstants.getConfigFolder() + File.separator + "misc"
|
||||
private static final String LOCAL_DATABASE_PATH = OpenHAB.getConfigFolder() + File.separator + "misc"
|
||||
+ File.separator + BINDING_ID;
|
||||
private static final String DATABASE_FILES = ".json";
|
||||
private static final Gson GSON = new GsonBuilder().serializeNulls().create();
|
||||
@@ -132,7 +132,7 @@ public class MiIoDatabaseWatchService extends AbstractWatchService {
|
||||
List<URL> urlEntries = new ArrayList<>();
|
||||
Bundle bundle = FrameworkUtil.getBundle(getClass());
|
||||
urlEntries.addAll(Collections.list(bundle.findEntries(MiIoBindingConstants.DATABASE_PATH, "*.json", false)));
|
||||
String userDbFolder = ConfigConstants.getConfigFolder() + File.separator + "misc" + File.separator + BINDING_ID;
|
||||
String userDbFolder = OpenHAB.getConfigFolder() + File.separator + "misc" + File.separator + BINDING_ID;
|
||||
try {
|
||||
File[] userDbFiles = new File(userDbFolder).listFiles((dir, name) -> name.endsWith(".json"));
|
||||
if (userDbFiles != null) {
|
||||
|
||||
@@ -34,7 +34,7 @@ import org.eclipse.jdt.annotation.NonNullByDefault;
|
||||
import org.eclipse.jdt.annotation.Nullable;
|
||||
import org.openhab.binding.miio.internal.MiIoBindingConstants;
|
||||
import org.openhab.binding.miio.internal.MiIoCryptoException;
|
||||
import org.openhab.core.config.core.ConfigConstants;
|
||||
import org.openhab.core.OpenHAB;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ import org.slf4j.Logger;
|
||||
public class CloudUtil {
|
||||
|
||||
private static final Random RANDOM = new Random();
|
||||
private static final String DB_FOLDER_NAME = ConfigConstants.getUserDataFolder() + File.separator
|
||||
private static final String DB_FOLDER_NAME = OpenHAB.getUserDataFolder() + File.separator
|
||||
+ MiIoBindingConstants.BINDING_ID;
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,8 +46,8 @@ import org.openhab.binding.miio.internal.robot.StatusDTO;
|
||||
import org.openhab.binding.miio.internal.robot.StatusType;
|
||||
import org.openhab.binding.miio.internal.robot.VacuumErrorType;
|
||||
import org.openhab.binding.miio.internal.transport.MiIoAsyncCommunication;
|
||||
import org.openhab.core.OpenHAB;
|
||||
import org.openhab.core.cache.ExpiringCache;
|
||||
import org.openhab.core.config.core.ConfigConstants;
|
||||
import org.openhab.core.library.types.DateTimeType;
|
||||
import org.openhab.core.library.types.DecimalType;
|
||||
import org.openhab.core.library.types.OnOffType;
|
||||
@@ -84,8 +84,7 @@ public class MiIoVacuumHandler extends MiIoAbstractHandler {
|
||||
private final Logger logger = LoggerFactory.getLogger(MiIoVacuumHandler.class);
|
||||
private static final float MAP_SCALE = 2.0f;
|
||||
private static final SimpleDateFormat DATEFORMATTER = new SimpleDateFormat("yyyyMMdd-HHmmss");
|
||||
private static final String MAP_PATH = ConfigConstants.getUserDataFolder() + File.separator + BINDING_ID
|
||||
+ File.separator;
|
||||
private static final String MAP_PATH = OpenHAB.getUserDataFolder() + File.separator + BINDING_ID + File.separator;
|
||||
private static final Gson GSON = new GsonBuilder().serializeNulls().create();
|
||||
private final ChannelUID mapChannelUid;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user