For IntelliJ IDEA,
Android Studio or Eclipse



@Override public void start() { Config config = Config.getInstance(); LOGGER.info("[Plugin] iris-devices-zwave plugin started!"); if (config.get("zwaveEnabled").equals("1")) { LOGGER.info("ZWave support enabled. Starting"); service = new ZWaveService(); } }
/** * Default constructor which loads properties from different storages. */ private Config() { synchronized (Config.class) { if (propertyMap != null) { return; } propertyMap = new ConcurrentHashMap<>(); loadPropertiesFromClassPath("/conf/iris-default.properties"); if (!loadPropertiesFromClassPath("/conf/iris-extended.properties")) { if (!loadPropertiesFromFileSystem("/conf/iris-extended.properties")) { loadPropertiesFromFileSystem("./conf/main.property"); } } loadPropertiesFromDatabase(); } }
@Override public String getAWSSecretKey() { return cfg.get("ivonaSecretKey"); } };
public WitAiService() final Config cfg = Config.getInstance(); final Gson gson = new GsonBuilder().disableHtmlEscaping().setPrettyPrinting().create();
@Override public String getAWSAccessKeyId() { return cfg.get("ivonaAccessKey"); }
@Override public void start() { Config config = Config.getInstance(); LOGGER.info("[Plugin] iris-devices-noolite plugin started!"); if (config.get("nooliteEnabled").equals("1")) { LOGGER.info("NooLite support enabled. Starting"); if (config.get("nooliteTXPresent").equals("1")) { LOGGER.info("NooLite TX support enabled. Starting"); txService = new NooliteTXService(); } if (config.get("nooliteRXPresent").equals("1")) { LOGGER.info("NooLite RX support enabled. Starting"); rxService = new NooliteRXService(); } } }
public void stop() { messaging.close(); manager.removeWatcher(watcher, null); manager.removeDriver(config.get("zwavePort")); } }
@Override public void start() { LOGGER.info("[Plugin] iris-ai plugin started!"); Config cfg = Config.getInstance(); if (cfg.get("witaiEnabled").equals("1")) { witai = new WitAiService(); } else { LOGGER.info("No AI specified in config file"); } }
if (conf.get("silence").equals("0")) {
public JsonConnection() { // Create a ConnectionFactory ConnectionFactory connectionFactory = new ConnectionFactory(); // Create a Connection try { Config config = Config.getInstance(); // Create a ConnectionFactory connectionFactory.setHost(config.get("AMQPhost")); connectionFactory.setPort(Integer.valueOf(config.get("AMQPport"))); connectionFactory.setUsername(config.get("AMQPuser")); connectionFactory.setPassword(config.get("AMQPpasswd")); /* The AMQ connection. */ Connection connection = connectionFactory.newConnection(); channel = connection.createChannel(); // Create exchange channel.exchangeDeclare("iris", "topic", true); } catch (IOException | TimeoutException e) { LOGGER.error("Error while connection to AMQP broker: " + e.getMessage()); System.exit(1); } }
httpget.addHeader("Authorization", "Bearer " + cfg.get("witaiKey"));
final Config conf = Config.getInstance(); String tts = conf.get("ttsEngine"); synthesiser = new GoogleSynthesiser(conf.get("googleKey")); break; case "yandex": synthesiser = new YandexSynthesiser(conf.get("yandexKey")); break; case "ivona": synthesiser.setLanguage(conf.get("language"));
Voice voice = new Voice(); voice.setName(cfg.get("ivonaVoice")); input.setData(synthText);
LOGGER.info("Weather service started (LAT: " + conf.get("weatherLatitude") + ", LON: " + conf.get("weatherLongitude") + ")"); DBLogger.info("Getting weather..."); ForecastIO fio = new ForecastIO(conf.get("weatherApi")); fio.setUnits(ForecastIO.UNITS_SI); fio.getForecast(conf.get("weatherLatitude"), conf.get("weatherLongitude")); fio.setLang(ForecastIO.LANG_RUSSIAN);