forked from a2633063/SmartControl_Android_MQTT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
1,586 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
app/src/main/java/com/zyc/zcontrol/deviceItem/DeviceClass/DeviceClockMatrix.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.zyc.zcontrol.deviceItem.DeviceClass; | ||
|
||
import android.preference.PreferenceFragment; | ||
|
||
import com.zyc.zcontrol.deviceItem.clockMatrix.ClockMatrixFragment; | ||
import com.zyc.zcontrol.deviceItem.clockMatrix.ClockMatrixSettingFragment; | ||
|
||
import androidx.fragment.app.Fragment; | ||
|
||
public class DeviceClockMatrix extends Device { | ||
|
||
public DeviceClockMatrix(String name, String mac) { | ||
super(TYPE_CLOCK_MATRIX, name, mac); | ||
} | ||
|
||
//region 必须重构的函数 | ||
public String[] getRecvMqttTopic() { | ||
String[] topic = new String[3]; | ||
topic[0] = "device/zclock_matrix/" + getMac() + "/state"; | ||
topic[1] = "device/zclock_matrix/" + getMac() + "/sensor"; | ||
topic[2] = "device/zclock_matrix/" + getMac() + "/availability"; | ||
return topic; | ||
} | ||
|
||
public String getSendMqttTopic() { | ||
return "device/zclock_matrix/" + getMac() + "/set"; | ||
} | ||
|
||
|
||
Fragment fragment; | ||
PreferenceFragment settingFragment; | ||
|
||
public Fragment getFragment() { | ||
if (fragment == null) { | ||
fragment = new ClockMatrixFragment(this); | ||
} | ||
return fragment; | ||
} | ||
|
||
public PreferenceFragment getSettingFragment() { | ||
if (settingFragment == null) { | ||
settingFragment = new ClockMatrixSettingFragment(this); | ||
} | ||
return settingFragment; | ||
} | ||
//endregion | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.