Skip to content

Commit

Permalink
Merge branch 'main' into fix/mqtt-protocol-23
Browse files Browse the repository at this point in the history
  • Loading branch information
CuiBenyong committed Nov 28, 2023
2 parents 4878389 + e7a06d7 commit 928ad7c
Show file tree
Hide file tree
Showing 49 changed files with 362 additions and 284 deletions.
200 changes: 11 additions & 189 deletions example/tuya-panel-kit/yarn.lock

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions packages/tuya-panel-acrylic-kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.1](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-acrylic-kit@0.2.0...tuya-panel-acrylic-kit@0.2.1) (2023-11-07)

**Note:** Version bump only for package tuya-panel-acrylic-kit





# [0.2.0](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-acrylic-kit@0.1.9...tuya-panel-acrylic-kit@0.2.0) (2023-09-13)

**Note:** Version bump only for package tuya-panel-acrylic-kit
Expand Down
22 changes: 11 additions & 11 deletions packages/tuya-panel-acrylic-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuya-panel-acrylic-kit",
"version": "0.2.0",
"version": "0.2.1",
"description": "Acrylic style component collection package",
"author": "ZengBeauty <2497752603@qq.com>",
"homepage": "https://github.com/tuya/tuya-panel-kit#readme",
Expand Down Expand Up @@ -29,15 +29,15 @@
"url": "https://github.com/tuya/tuya-panel-kit/issues"
},
"dependencies": {
"tuya-panel-style-block-card": "^0.2.0",
"tuya-panel-style-button": "^0.2.0",
"tuya-panel-style-depict-card": "^0.2.0",
"tuya-panel-style-display-card": "^0.2.0",
"tuya-panel-style-enum-button-group": "^0.2.0",
"tuya-panel-style-enum-card": "^0.2.0",
"tuya-panel-style-enum-slider-card": "^0.2.0",
"tuya-panel-style-icon-card": "^0.2.0",
"tuya-panel-style-slider-card": "^0.2.0",
"tuya-panel-style-switch-card": "^0.2.0"
"tuya-panel-style-block-card": "^0.2.1",
"tuya-panel-style-button": "^0.2.1",
"tuya-panel-style-depict-card": "^0.2.1",
"tuya-panel-style-display-card": "^0.2.1",
"tuya-panel-style-enum-button-group": "^0.2.1",
"tuya-panel-style-enum-card": "^0.2.1",
"tuya-panel-style-enum-slider-card": "^0.2.1",
"tuya-panel-style-icon-card": "^0.2.1",
"tuya-panel-style-slider-card": "^0.2.1",
"tuya-panel-style-switch-card": "^0.2.1"
}
}
8 changes: 8 additions & 0 deletions packages/tuya-panel-classic-kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.1](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-classic-kit@0.2.0...tuya-panel-classic-kit@0.2.1) (2023-11-07)

**Note:** Version bump only for package tuya-panel-classic-kit





# [0.2.0](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-classic-kit@0.1.9...tuya-panel-classic-kit@0.2.0) (2023-09-13)

**Note:** Version bump only for package tuya-panel-classic-kit
Expand Down
26 changes: 13 additions & 13 deletions packages/tuya-panel-classic-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuya-panel-classic-kit",
"version": "0.2.0",
"version": "0.2.1",
"description": "Classic style component collection package",
"author": "ZengBeauty <2497752603@qq.com>",
"homepage": "https://github.com/tuya/tuya-panel-kit#readme",
Expand Down Expand Up @@ -29,17 +29,17 @@
"url": "https://github.com/tuya/tuya-panel-kit/issues"
},
"dependencies": {
"tuya-panel-style-block-card": "^0.2.0",
"tuya-panel-style-button": "^0.2.0",
"tuya-panel-style-button-card": "^0.2.0",
"tuya-panel-style-depict-card": "^0.2.0",
"tuya-panel-style-display-card": "^0.2.0",
"tuya-panel-style-enum-card": "^0.2.0",
"tuya-panel-style-enum-tabs-button-card": "^0.2.0",
"tuya-panel-style-icon-background": "^0.2.0",
"tuya-panel-style-icon-card": "^0.2.0",
"tuya-panel-style-slider-card": "^0.2.0",
"tuya-panel-style-step-card": "^0.2.0",
"tuya-panel-style-switch-card": "^0.2.0"
"tuya-panel-style-block-card": "^0.2.1",
"tuya-panel-style-button": "^0.2.1",
"tuya-panel-style-button-card": "^0.2.1",
"tuya-panel-style-depict-card": "^0.2.1",
"tuya-panel-style-display-card": "^0.2.1",
"tuya-panel-style-enum-card": "^0.2.1",
"tuya-panel-style-enum-tabs-button-card": "^0.2.1",
"tuya-panel-style-icon-background": "^0.2.1",
"tuya-panel-style-icon-card": "^0.2.1",
"tuya-panel-style-slider-card": "^0.2.1",
"tuya-panel-style-step-card": "^0.2.1",
"tuya-panel-style-switch-card": "^0.2.1"
}
}
11 changes: 11 additions & 0 deletions packages/tuya-panel-kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [4.10.1](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-kit@4.10.0...tuya-panel-kit@4.10.1) (2023-11-07)


### Bug Fixes

* Pop-up dialog for unsupported device signal strength on certain newly added device type ([7235b0f](https://github.com/tuya/tuya-panel-kit/commit/7235b0fb393269f661273ac3e7b897f89a46b112))





# [4.10.0](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-kit@4.9.4...tuya-panel-kit@4.10.0) (2023-09-13)


Expand Down
2 changes: 1 addition & 1 deletion packages/tuya-panel-kit/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuya-panel-kit",
"version": "4.10.0",
"version": "4.10.1",
"description": "a functional component library for developing tuya device panels!",
"keywords": [
"tuya",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ export default class NavigatorLayout extends Component {
constructor(props) {
super(props);

this._deviceRssiInfo = null;
this._sceneConfigs = this.__sceneConfigs.bind(this);
this._renderScene = this.__renderScene.bind(this);
this._onDidFocus = this.__onDidFocus.bind(this);
Expand Down Expand Up @@ -148,6 +149,20 @@ export default class NavigatorLayout extends Component {
return false;
}

_getRssiInfo = async () => {
if (this._deviceRssiInfo === null) {
return getRssi().then(res => {
if (!res) {
this._deviceRssiInfo = {};
} else {
this._deviceRssiInfo = res;
}
return this._deviceRssiInfo;
});
}
return this._deviceRssiInfo;
};

_handleAppStateChange = nextAppState => {
if (nextAppState === 'background') {
Notification.hide();
Expand All @@ -159,11 +174,14 @@ export default class NavigatorLayout extends Component {
if (protocol === 23) {
const { data: result } = data;
const { signal } = result;
getRssi().then(res => {
this._getRssiInfo().then(res => {
if (!res) {
return;
}
const { value: rssi } = res;
const { value: rssi, supported } = res;
if (supported !== true) {
return;
}
if (signal < rssi && AppState.currentState === 'active') {
this.timer && clearTimeout(this.timer);
this.setState({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ export default function createNavigator({ router, screenOptions }, navigationCon
isMqttNoticeActive: false,
};
this.navigationRef = null;
this._deviceRssiInfo = null;
}

componentDidMount() {
Expand Down Expand Up @@ -195,6 +196,20 @@ export default function createNavigator({ router, screenOptions }, navigationCon
return false;
};

_getRssiInfo = async () => {
if (this._deviceRssiInfo === null) {
return getRssi().then(res => {
if (!res) {
this._deviceRssiInfo = {};
} else {
this._deviceRssiInfo = res;
}
return this._deviceRssiInfo;
});
}
return this._deviceRssiInfo;
};

_handleAppStateChange = nextAppState => {
if (nextAppState === 'background') {
Notification.hide();
Expand All @@ -213,11 +228,14 @@ export default function createNavigator({ router, screenOptions }, navigationCon
const { data: result } = data;
if (!result || result.signal === undefined) return;
const { signal } = result;
getRssi().then(res => {
this._getRssiInfo().then(res => {
if (!res) {
return;
}
const { value: rssi } = res;
const { value: rssi, supported } = res;
if (supported !== true) {
return;
}
if (signal < rssi && AppState.currentState === 'active') {
this.timer && clearTimeout(this.timer);
this.setState({
Expand Down
11 changes: 11 additions & 0 deletions packages/tuya-panel-layout/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,17 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.1](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-layout@0.2.0...tuya-panel-layout@0.2.1) (2023-11-07)


### Bug Fixes

* Pop-up dialog for unsupported device signal strength on certain newly added device type ([7235b0f](https://github.com/tuya/tuya-panel-kit/commit/7235b0fb393269f661273ac3e7b897f89a46b112))





# [0.2.0](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-layout@0.1.9...tuya-panel-layout@0.2.0) (2023-09-13)

**Note:** Version bump only for package tuya-panel-layout
Expand Down
6 changes: 3 additions & 3 deletions packages/tuya-panel-layout/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "tuya-panel-layout",
"version": "0.2.0",
"version": "0.2.1",
"description": "tuya-panel-layout",
"author": "ZengBeauty <2497752603@qq.com>",
"homepage": "https://github.com/tuya/tuya-panel-kit#readme",
Expand Down Expand Up @@ -40,9 +40,9 @@
"styled-components": "^3.4.10",
"tuya-panel-core": "^0.0.1",
"tuya-panel-i18n": "^0.1.1",
"tuya-panel-kit": "^4.10.0",
"tuya-panel-kit": "^4.10.1",
"tuya-panel-theme": "^0.1.2",
"tuya-panel-topbar": "^0.2.0",
"tuya-panel-topbar": "^0.2.1",
"tuya-panel-utils": "^0.2.1"
},
"bugs": {
Expand Down
23 changes: 21 additions & 2 deletions packages/tuya-panel-layout/src/navigator-layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default class NavigatorLayout extends Component<INavigatorProps, INavigat
constructor(props) {
super(props);

this._deviceRssiInfo = null;
this._sceneConfigs = this.__sceneConfigs.bind(this);
this._renderScene = this.__renderScene.bind(this);
this._onDidFocus = this.__onDidFocus.bind(this);
Expand Down Expand Up @@ -129,9 +130,24 @@ export default class NavigatorLayout extends Component<INavigatorProps, INavigat
return false;
}

_getRssiInfo = async () => {
if (this._deviceRssiInfo === null) {
return getRssi().then(res => {
if (!res) {
this._deviceRssiInfo = {};
} else {
this._deviceRssiInfo = res;
}
return this._deviceRssiInfo;
});
}
return this._deviceRssiInfo;
};

timer: number;
opts: any;
fullViewRef: any;
_deviceRssiInfo: null | { value?: number; supported?: boolean };
_onWillFocus: () => void;
_renderScene: () => void;
_sceneConfigs: () => void;
Expand Down Expand Up @@ -172,11 +188,14 @@ export default class NavigatorLayout extends Component<INavigatorProps, INavigat
if (protocol === 23) {
const { data: result } = data;
const { signal } = result;
getRssi().then((res: { value: number }) => {
this._getRssiInfo().then((res: { value: number; supported: boolean }) => {
if (!res) {
return;
}
const { value: rssi } = res;
const { value: rssi, supported } = res;
if (supported !== true) {
return;
}
if (signal < rssi && AppState.currentState === 'active') {
this.timer && clearTimeout(this.timer);
this.setState({
Expand Down
23 changes: 21 additions & 2 deletions packages/tuya-panel-layout/src/react-navigation/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export default function createNavigator(
isMqttNoticeActive: false,
};
this.navigationRef = null;
this._deviceRssiInfo = null;
}

componentDidMount() {
Expand Down Expand Up @@ -165,6 +166,7 @@ export default function createNavigator(
navigationState: NavigationState;
opts: any;
fullViewRef: React.RefObject<IFullViewProps>;
_deviceRssiInfo: null | { value?: number; supported?: boolean };

sendEventInfo(eventType, state) {
const enablePageTrack = get(TYSdk, 'devInfo.panelConfig.fun.enablePageTrack', false);
Expand Down Expand Up @@ -207,6 +209,20 @@ export default function createNavigator(
return false;
};

_getRssiInfo = async () => {
if (this._deviceRssiInfo === null) {
return getRssi().then(res => {
if (!res) {
this._deviceRssiInfo = {};
} else {
this._deviceRssiInfo = res;
}
return this._deviceRssiInfo;
});
}
return this._deviceRssiInfo;
};

_handleAppStateChange = nextAppState => {
if (nextAppState === 'background') {
Notification.hide();
Expand All @@ -230,11 +246,14 @@ export default function createNavigator(
if (protocol === 23) {
const { data: result } = data;
const { signal } = result;
getRssi().then((res: { value: number }) => {
this._getRssiInfo().then((res: { value: number; supported: boolean }) => {
if (!res) {
return;
}
const { value: rssi } = res;
const { value: rssi, supported } = res;
if (supported !== true) {
return;
}
if (signal < rssi && AppState.currentState === 'active') {
this.timer && clearTimeout(this.timer);
this.setState({
Expand Down
8 changes: 8 additions & 0 deletions packages/tuya-panel-nordic-kit/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [0.2.1](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-nordic-kit@0.2.0...tuya-panel-nordic-kit@0.2.1) (2023-11-07)

**Note:** Version bump only for package tuya-panel-nordic-kit





# [0.2.0](https://github.com/tuya/tuya-panel-kit/compare/tuya-panel-nordic-kit@0.1.9...tuya-panel-nordic-kit@0.2.0) (2023-09-13)

**Note:** Version bump only for package tuya-panel-nordic-kit
Expand Down

0 comments on commit 928ad7c

Please sign in to comment.