@eohjsc/react-native-smart-city 0.4.58 → 0.4.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@eohjsc/react-native-smart-city",
3
3
  "title": "React Native Smart Home",
4
- "version": "0.4.58",
4
+ "version": "0.4.59",
5
5
  "description": "TODO",
6
6
  "main": "index.js",
7
7
  "files": [
@@ -98,6 +98,10 @@ const ItemQuickAction = memo(
98
98
  on_action?.id,
99
99
  ]);
100
100
 
101
+ if (!config_id) {
102
+ return <View />;
103
+ }
104
+
101
105
  return (
102
106
  <TouchableOpacity
103
107
  accessibilityLabel={`${AccessibilityLabel.ITEM_QUICK_ACTION_PRESS}-${sensor?.id}`}
@@ -4,7 +4,7 @@ export default StyleSheet.create({
4
4
  calendar: {
5
5
  borderTopLeftRadius: 20,
6
6
  borderTopRightRadius: 20,
7
- marginBottom: 50,
7
+ marginBottom: 100,
8
8
  },
9
9
  arrowRight: {
10
10
  transform: [{ rotate: '180deg' }],
@@ -6,7 +6,7 @@ export default StyleSheet.create({
6
6
  justifyContent: 'center',
7
7
  alignItems: 'center',
8
8
  height: 180,
9
- marginBottom: 50,
9
+ marginBottom: 100,
10
10
  },
11
11
  picker: {
12
12
  width: 120,
@@ -10,12 +10,7 @@ import { AUTOMATE_TYPE } from '../../../configs/Constants';
10
10
 
11
11
  const SelectMonitorDevices = ({ route }) => {
12
12
  const t = useTranslations();
13
- const {
14
- automate = {},
15
- isCreateNewAction,
16
- closeScreen,
17
- unit,
18
- } = route?.params || {};
13
+ const { automate = {}, isCreateNewAction, closeScreen } = route?.params || {};
19
14
 
20
15
  const [stations, setStations] = useState([]);
21
16
  const [listStation, setListStation] = useState([]);
@@ -31,7 +26,7 @@ const SelectMonitorDevices = ({ route }) => {
31
26
  configs.params.type = 'event';
32
27
  }
33
28
  await fetchWithCache(
34
- API.UNIT.DEVICE_SENSOR(automate?.unit ? automate?.unit : unit.id),
29
+ API.UNIT.DEVICE_SENSOR(automate?.unit),
35
30
  configs,
36
31
  (response) => {
37
32
  const { success, data } = response;
@@ -50,7 +45,7 @@ const SelectMonitorDevices = ({ route }) => {
50
45
  }
51
46
  );
52
47
  setLoading(false);
53
- }, [automate?.type, automate?.unit, unit.id]);
48
+ }, [automate?.type, automate?.unit]);
54
49
 
55
50
  useEffect(() => {
56
51
  if (!automate?.sensor_id) {
@@ -58,13 +58,13 @@ const SetupConfigCondition = () => {
58
58
  if (item.evaluate_template === 'boolean') {
59
59
  return [
60
60
  {
61
- title: item.evaluate_configuration?.on?.text,
61
+ title: item.evaluate_configuration?.off?.text,
62
62
  condition: 'value_evaluation',
63
63
  config: item.id,
64
64
  value: 0,
65
65
  },
66
66
  {
67
- title: item.evaluate_configuration?.off?.text,
67
+ title: item.evaluate_configuration?.on?.text,
68
68
  condition: 'value_evaluation',
69
69
  config: item.id,
70
70
  value: 1,
@@ -172,8 +172,8 @@ describe('Test SetupConfigCondition', () => {
172
172
  );
173
173
  const texts = modalCustom.findAllByType(Text);
174
174
  expect(texts).toHaveLength(2);
175
- expect(texts[0].props.children).toEqual('Case On');
176
- expect(texts[1].props.children).toEqual('Case Off');
175
+ expect(texts[1].props.children).toEqual('Case On');
176
+ expect(texts[0].props.children).toEqual('Case Off');
177
177
  });
178
178
 
179
179
  const testConditionValue = async (value, message) => {