@ledvance/base 1.3.32 → 1.3.34

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
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.3.32",
7
+ "version": "1.3.34",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -21,6 +21,8 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
21
21
  const { dps } = props.deviceInfo
22
22
  const curPowerDp = getGlobalParamsDp('cur_power')
23
23
  const curPower = dps && JSON.parse(dps) && JSON.parse(dps)[curPowerDp]
24
+ const tempCurrentDp = getGlobalParamsDp('temp_current')
25
+ const tempCurrent = dps && JSON.parse(dps) && JSON.parse(dps)[tempCurrentDp]
24
26
 
25
27
  const styles = StyleSheet.create({
26
28
  root: {
@@ -88,12 +90,15 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
88
90
  </View>
89
91
  <Spacer height={cx(6)} />
90
92
  </View>
91
- <View style={[styles.offlineIcon, {marginHorizontal: cx(5)}]}>
93
+ <View style={[styles.offlineIcon, { marginHorizontal: cx(5) }]}>
92
94
  {!props.deviceInfo.status && <Image style={styles.offlineIcon} source={res.offline_wifi} />}
93
- {!!props.deviceInfo.status && isNumber(curPower) && <View style={{alignItems: 'flex-end'}}>
95
+ {!!props.deviceInfo.status && isNumber(curPower) && <View style={{ alignItems: 'flex-end' }}>
94
96
  <Text style={styles.onlineText}>{`${curPower / 10} W`}</Text>
95
- <Text style={[styles.onlineText, {fontSize: cx(12),marginTop: cx(5)}]}>{I18n.getLang('consumption_data_field1_headline_text')}</Text>
96
- </View>}
97
+ <Text style={[styles.onlineText, { fontSize: cx(12), marginTop: cx(5) }]}>{I18n.getLang('consumption_data_field1_headline_text')}</Text>
98
+ </View>}
99
+ {!!props.deviceInfo.status && isNumber(tempCurrent) && <View style={{ alignItems: 'flex-end' }}>
100
+ <Text style={styles.onlineText}>{`${tempCurrent / 10} ℃`}</Text>
101
+ </View>}
97
102
  </View>
98
103
  </View>
99
104
  )
@@ -3,7 +3,7 @@ import I18n from '../i18n/index'
3
3
  import { formatNumber, openDownloadFile } from 'api/native'
4
4
  import dayjs from 'dayjs'
5
5
  import RNFetchBlob from 'rn-fetch-blob'
6
- import { isEqual } from 'lodash'
6
+ import { cloneDeep, isEqual } from 'lodash'
7
7
  import { Dialog, Utils } from 'tuya-panel-kit'
8
8
  import {GlobalParams} from "../models/GlobalParams";
9
9
 
@@ -448,17 +448,26 @@ export function isConflictTask(task1, task2) {
448
448
  function checkOverlap(start1, end1, start2, end2) {
449
449
  return (start1 <= end2 && start2 <= end1);
450
450
  }
451
+ const cloneTask1 = cloneDeep(task1)
452
+ const cloneTask2 = cloneDeep(task2)
453
+ const weekDay = dayjs().day()
454
+ if (cloneTask1.weeks.every(w => Number(w) === 0)){
455
+ cloneTask1.weeks[weekDay] = 1
456
+ }
457
+ if (cloneTask2.weeks.every(w => Number(w) === 0)){
458
+ cloneTask2.weeks[weekDay] = 1
459
+ }
451
460
  // 检查一周的每一天
452
461
  for (let i = 0; i < 7; i++) {
453
462
  // 如果 task1 在该天执行
454
- if (Number(task1.weeks[i]) === 1) {
455
- const [start1, end1] = [task1.startTime, task1.endTime];
463
+ if (Number(cloneTask1.weeks[i]) === 1) {
464
+ const [start1, end1] = [cloneTask1.startTime, cloneTask1.endTime];
456
465
  const task1CrossDay = start1 > end1;
457
466
 
458
467
  // 如果 task2 在该天或跨天执行
459
468
  for (let j = 0; j < 7; j++) {
460
- if (Number(task2.weeks[j]) === 1) {
461
- const [start2, end2] = [task2.startTime, task2.endTime];
469
+ if (Number(cloneTask2.weeks[j]) === 1) {
470
+ const [start2, end2] = [cloneTask2.startTime, cloneTask2.endTime];
462
471
  const task2CrossDay = start2 > end2;
463
472
  // 检查当前天是否有重叠
464
473
  if (i === j && checkOverlap(start1, end1, start2, end2)) {