use of org.openhab.core.thing.profiles.ProfileContext in project openhab-addons by openhab.
the class ModbusGainOffsetProfileTest method createProfile.
private ModbusGainOffsetProfile<?> createProfile(ProfileCallback callback, @Nullable String gain, @Nullable String preGainOffset) {
ProfileContext context = mock(ProfileContext.class);
Configuration config = new Configuration();
if (gain != null) {
config.put("gain", gain);
}
if (preGainOffset != null) {
config.put("pre-gain-offset", preGainOffset);
}
when(context.getConfiguration()).thenReturn(config);
return new ModbusGainOffsetProfile<>(callback, context);
}
use of org.openhab.core.thing.profiles.ProfileContext in project openhab-core by openhab.
the class SystemOffsetProfileTest method createProfile.
private SystemOffsetProfile createProfile(ProfileCallback callback, String offset) {
ProfileContext context = mock(ProfileContext.class);
Configuration config = new Configuration();
config.put(SystemOffsetProfile.OFFSET_PARAM, offset);
when(context.getConfiguration()).thenReturn(config);
return new SystemOffsetProfile(callback, context);
}
use of org.openhab.core.thing.profiles.ProfileContext in project addons by smarthomej.
the class BitwiseAndTransformationProfileTest method createProfile.
private MultiplyTransformationProfile createProfile(ProfileCallback callback, Integer multiplicand) {
ProfileContext context = mock(ProfileContext.class);
Configuration config = new Configuration();
config.put(MultiplyTransformationProfile.MUTLIPLICAND_PARAM, multiplicand);
when(context.getConfiguration()).thenReturn(config);
return new MultiplyTransformationProfile(callback, context, new MultiplyTransformationService());
}
use of org.openhab.core.thing.profiles.ProfileContext in project openhab-core by openhab.
the class TimestampOffsetProfileTest method createProfile.
private TimestampOffsetProfile createProfile(ProfileCallback callback, String offset, @Nullable String timeZone) {
ProfileContext context = mock(ProfileContext.class);
Map<String, Object> properties = new HashMap<>();
properties.put(TimestampOffsetProfile.OFFSET_PARAM, offset);
if (timeZone != null) {
properties.put(TimestampOffsetProfile.TIMEZONE_PARAM, timeZone);
}
when(context.getConfiguration()).thenReturn(new Configuration(properties));
return new TimestampOffsetProfile(callback, context);
}
use of org.openhab.core.thing.profiles.ProfileContext in project addons by smarthomej.
the class MultiplyTransformationProfileTest method createProfile.
private MultiplyTransformationProfile createProfile(ProfileCallback callback, Integer multiplicand) {
ProfileContext context = mock(ProfileContext.class);
Configuration config = new Configuration();
config.put(MultiplyTransformationProfile.MUTLIPLICAND_PARAM, multiplicand);
when(context.getConfiguration()).thenReturn(config);
return new MultiplyTransformationProfile(callback, context, new MultiplyTransformationService());
}
Aggregations