@ledvance/base 1.3.9 → 1.3.11

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/localazy.json CHANGED
@@ -900,7 +900,10 @@
900
900
  "MATCH:thermostat_maxtime",
901
901
  "MATCH:thermostat_schedule",
902
902
  "MATCH:thermostat_unit",
903
- "MATCH:thermostat_comforttemp"
903
+ "MATCH:thermostat_comforttemp",
904
+ "MATCH:mood_resetbutton",
905
+ "MATCH:reset_mooddescription",
906
+ "MATCH:settings_wateralarmrecovery"
904
907
  ],
905
908
  "replacements": {
906
909
  "REGEX:% %1\\$s.*?\\)%": "{0}",
@@ -1,4 +1,5 @@
1
1
  {
2
- "writeKey": "",
3
- "readKey": "a7349213573288779040-d092b120e7d6d90c7e9528ddf2aa600659f60631bd4a5c2d55de0aa2b081af1b"
4
- }
2
+ "writeKey": "",
3
+ "readKey": "a7349213573288779040-d092b120e7d6d90c7e9528ddf2aa600659f60631bd4a5c2d55de0aa2b081af1b"
4
+ }
5
+
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "@ledvance/base",
5
5
  "pid": [],
6
6
  "uiid": "",
7
- "version": "1.3.9",
7
+ "version": "1.3.11",
8
8
  "scripts": {
9
9
  "prepublishOnly": "python update-localazy.py"
10
10
  },
@@ -4,7 +4,7 @@ import AdvanceCard, { AdvancedData } from './AdvanceCard'
4
4
  import Spacer from './Spacer'
5
5
  import { useNavigation } from '@react-navigation/core'
6
6
  import { Utils } from 'tuya-panel-kit'
7
- import { getMicrophoneAccess } from '@ledvance/base/src/api/native'
7
+ import { getMicrophoneAccess } from '../api/native'
8
8
 
9
9
  const { convertX: cx } = Utils.RatioUtils
10
10
 
@@ -27,7 +27,7 @@ function AdvanceList(props: AdvanceListProps) {
27
27
  onPress={async () => {
28
28
  if(MusicRouterKey.includes(item.router.key)){
29
29
  getMicrophoneAccess().then(res =>{
30
- if(!res) return
30
+ if(!res) return
31
31
  navigation.navigate(item.router.key, item.router.params)
32
32
  })
33
33
  }else{
@@ -77,4 +77,4 @@ const styles = StyleSheet.create({
77
77
  },
78
78
  })
79
79
 
80
- export default React.memo(AdvanceList)
80
+ export default React.memo(AdvanceList)
@@ -5,6 +5,9 @@ import { DeviceInfo } from '../api/native'
5
5
  import Spacer from './Spacer'
6
6
  import res from '../res'
7
7
  import ThemeType from '../config/themeType'
8
+ import { getGlobalParamsDp } from '../utils/common'
9
+ import I18n from '../i18n'
10
+ import { isNumber } from 'lodash'
8
11
 
9
12
  const cx = Utils.RatioUtils.convertX
10
13
  const { withTheme } = Utils.ThemeUtils
@@ -15,6 +18,9 @@ export interface ApplyForDeviceItemProps {
15
18
  }
16
19
 
17
20
  const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
21
+ const { dps } = props.deviceInfo
22
+ const curPowerDp = getGlobalParamsDp('cur_power')
23
+ const curPower = dps && JSON.parse(dps) && JSON.parse(dps)[curPowerDp]
18
24
 
19
25
  const styles = StyleSheet.create({
20
26
  root: {
@@ -59,8 +65,12 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
59
65
  fontFamily: 'helvetica_neue_lt_std_roman',
60
66
  },
61
67
  offlineIcon: {
62
- width: cx(24),
63
- height: cx(24)
68
+ minWidth: cx(24),
69
+ minHeight: cx(24)
70
+ },
71
+ onlineText: {
72
+ color: props.theme?.global.fontColor,
73
+ fontSize: cx(14),
64
74
  }
65
75
  })
66
76
 
@@ -78,8 +88,12 @@ const ApplyForDeviceItem = (props: ApplyForDeviceItemProps) => {
78
88
  </View>
79
89
  <Spacer height={cx(6)} />
80
90
  </View>
81
- <View style={[styles.offlineIcon, {marginRight: cx(5)}]}>
91
+ <View style={[styles.offlineIcon, {marginHorizontal: cx(5)}]}>
82
92
  {!props.deviceInfo.status && <Image style={styles.offlineIcon} source={res.offline_wifi} />}
93
+ {!!props.deviceInfo.status && isNumber(curPower) && <View style={{alignItems: 'flex-end'}}>
94
+ <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>}
83
97
  </View>
84
98
  </View>
85
99
  )
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import Card from '@ledvance/base/src/components/Card';
2
+ import Card from './Card';
3
3
  import { Battery, Utils } from 'tuya-panel-kit';
4
4
  import { View, Text, StyleSheet } from 'react-native';
5
- import I18n from '@ledvance/base/src/i18n';
6
- import Spacer from '@ledvance/base/src/components/Spacer';
5
+ import I18n from '../i18n';
6
+ import Spacer from './Spacer';
7
7
 
8
8
  const cx = Utils.RatioUtils.convertX;
9
9
  type BatteryProps = {
@@ -1,4 +1,4 @@
1
- import { exchangeNumber, localeNumber } from "@ledvance/base/src/utils/common";
1
+ import { exchangeNumber, localeNumber } from "../utils/common";
2
2
  import res from "@res";
3
3
  import { useReactive } from "ahooks";
4
4
  import React, { memo, useCallback } from "react";
@@ -69,7 +69,7 @@ const TextField = (props: TextFieldProps) => {
69
69
  <Text style={[styles.topTip, { opacity: (!!props.value) ? 1 : 0 }]}>{props.placeholder}</Text>
70
70
  <View style={styles.textInputGroup}>
71
71
  <TextInput{...props} style={styles.textInput} />
72
- {!!props.value &&
72
+ {!!props.value && props.editable &&
73
73
  <TouchableOpacity
74
74
  style={styles.iconTouchable}
75
75
  onPress={() => {
@@ -9,7 +9,7 @@ const { withTheme } = Utils.ThemeUtils
9
9
  interface Prop {
10
10
  theme?: ThemeType
11
11
  title: string
12
- color: string
12
+ color?: string
13
13
  colorAlpha: number
14
14
  enable: boolean
15
15
  setEnable: (enable: boolean) => void
@@ -24,7 +24,7 @@ const LdvSwitch = (props: Prop) => {
24
24
  <View style={{flexDirection: 'column', flex: 1}}>
25
25
  <View style={{flexDirection: 'row', alignItems: 'center'}}>
26
26
  <Text style={{...styles.title, color: props.theme?.global.fontColor}}>{title}</Text>
27
- <View style={[styles.colorBlock, {backgroundColor: color, opacity: colorAlpha}]}/>
27
+ <View style={[styles.colorBlock, {backgroundColor: color || props.theme?.card.background, opacity: colorAlpha}]}/>
28
28
  </View>
29
29
  {description && <Text style={{color: props.theme?.global.fontColor}}>{description}</Text>}
30
30
  </View>
@@ -1,4 +1,4 @@
1
- import Spacer from '@ledvance/base/src/components/Spacer'
1
+ import Spacer from './Spacer'
2
2
  import React from 'react'
3
3
  import { Image, StyleSheet, Text, TouchableOpacity, View } from 'react-native'
4
4
  import { Utils } from 'tuya-panel-kit'