mirror of
https://github.com/scottlamb/moonfire-nvr.git
synced 2025-11-20 01:50:24 -05:00
remove the JsonWrapper class
Let's follow the Google Style Guide, in which private variables are simply suffixed with "_". It's a sign, not a cop, but that's fine. I'd rather keep things simple, and code review should suffice for catching uses of a private variable outside the class.
This commit is contained in:
@@ -30,20 +30,19 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import JsonWrapper from './JsonWrapper';
|
||||
import Stream from './Stream';
|
||||
|
||||
/**
|
||||
* Camera JSON wrapper.
|
||||
*/
|
||||
export default class Camera extends JsonWrapper {
|
||||
export default class Camera {
|
||||
/**
|
||||
* Construct from JSON.
|
||||
*
|
||||
* @param {JSON} cameraJson JSON for single camera.
|
||||
*/
|
||||
constructor(cameraJson) {
|
||||
super(cameraJson);
|
||||
this.json_ = cameraJson;
|
||||
this.streams_ = {};
|
||||
Object.keys(cameraJson.streams).forEach((streamType) => {
|
||||
this.streams_[streamType] = new Stream(cameraJson.streams[streamType]);
|
||||
@@ -52,17 +51,17 @@ export default class Camera extends JsonWrapper {
|
||||
|
||||
/** @return {String} */
|
||||
get uuid() {
|
||||
return this.json.uuid;
|
||||
return this.json_.uuid;
|
||||
}
|
||||
|
||||
/** @return {String} */
|
||||
get shortName() {
|
||||
return this.json.shortName;
|
||||
return this.json_.shortName;
|
||||
}
|
||||
|
||||
/** @return {String} */
|
||||
get description() {
|
||||
return this.json.description;
|
||||
return this.json_.description;
|
||||
}
|
||||
|
||||
/** @return {Object.<string, Stream>} */
|
||||
|
||||
Reference in New Issue
Block a user